Sites
Create and manage the sites in your Fathom account.
List sites#
GET/sites
Return a list of all sites this API key owns. Sites are sorted by created_at ascending to allow you to paginate with ease.
Query parameters
- limitintegeroptional
- A limit on the number of objects to be returned, between 1 and 100.
- starting_afterstringoptional
- A cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For example, if you make a list request and receive 10 objects ending withobj_foo, your subsequent call can includestarting_after=obj_footo fetch the next page. - ending_beforestringoptional
- A cursor for use in pagination, working in the opposite direction to
starting_after.ending_beforeis an object ID that defines your place in the list.
Returns
A list of site objects.
curl "https://api.usefathom.com/v1/sites" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"{
"object": "list",
"url": "/v1/sites",
"has_more": false,
"data": [
{
"id": "CDBUGS",
"object": "site",
"name": "Bugs Bunny Portfolio",
"sharing": "none",
"created_at": "2020-07-27 12:01:01",
"timezone": "America/New_York"
}
]
}Get site#
GET/sites/{site_id}
Return a single site.
Path parameters
- site_idstringrequired
- The ID of the site. This is the same string you use in your tracking code.
Example:CDBUGS
Returns
A site object.
curl "https://api.usefathom.com/v1/sites/CDBUGS" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"{
"id": "CDBUGS",
"object": "site",
"name": "Bugs Bunny Portfolio",
"sharing": "none",
"created_at": "2020-07-27 12:01:01",
"timezone": "America/New_York"
}Create site#
POST/sites
Create a site.
Body parameters
- namestringrequired
- The name of the website. Any string (up to 255 characters) is acceptable, and it doesn't have to match the website URL.
Example:Daffy's Website - sharingstringoptional
- The sharing configuration. Supported values are
none,privateorpublic. - share_passwordstringRequired if sharing is private
- When sharing is set to
private, you must also send a password to access the site with (up to 255 characters). - timezonestringoptional
- The site's reporting timezone as a TZ database name (e.g.
America/New_York). If omitted, the site inherits your account's default timezone. - multi_domainbooleanoptional
- Set to
trueto allow this site to track multiple domains. - multi_domain_optionstringRequired if multi_domain is true
- How multi-domain data is grouped. Supported values are
combined(report all domains together) orseparate(report each domain individually).
Returns
A site object.
curl -X POST "https://api.usefathom.com/v1/sites" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Bugs Bunny Portfolio"
}'{
"id": "GCDFS",
"object": "site",
"name": "Acme Inc",
"sharing": "none",
"created_at": "2021-08-10 00:45:43",
"timezone": "America/New_York"
}Update site#
POST/sites/{site_id}
Update a site. Send only the fields you want to change.
Path parameters
- site_idstringrequired
- The ID of the site. This is the same string you use in your tracking code.
Example:CDBUGS
Body parameters
- namestringoptional
- The name of the website (up to 255 characters).
- sharingstringoptional
- The sharing configuration. Supported values are
none,privateorpublic. - share_passwordstringRequired if sharing is private
- When sharing is set to
private, you must also send a password to access the site with (up to 255 characters). - timezonestringoptional
- The site's reporting timezone as a TZ database name (e.g.
America/New_York). Reporting for this site will use this timezone. - multi_domainbooleanoptional
- Set to
trueto allow this site to track multiple domains. - multi_domain_optionstringRequired if multi_domain is true
- How multi-domain data is grouped:
combinedorseparate.
Returns
A site object.
curl -X POST "https://api.usefathom.com/v1/sites/CDBUGS" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"{
"id": "GCDFS",
"object": "site",
"name": "Acme Holdings Inc",
"sharing": "private",
"created_at": "2021-08-10 00:45:43",
"timezone": "America/New_York"
}Wipe site#
DeprecatedDELETE/sites/{site_id}/data
This endpoint is no longer available
410 Gone. It is no longer possible to wipe a site's data via the API.Previously wiped all pageviews and event completions from a website. This endpoint is no longer available.
Path parameters
- site_idstringrequired
- The ID of the site. This is the same string you use in your tracking code.
Example:CDBUGS
Delete site#
DELETE/sites/{site_id}
Delete a site. Careful: you can't undo this, and neither can we.
Path parameters
- site_idstringrequired
- The ID of the site. This is the same string you use in your tracking code.
Example:CDBUGS
Returns
Returns a deleted object on success. Otherwise, this call returns an error.
curl -X DELETE "https://api.usefathom.com/v1/sites/CDBUGS" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"{
"id": "GCDFS",
"object": "site",
"deleted": true
}