API reference
Browse API documentation

Events

Manage events for a site.

List events#

GET/sites/{site_id}/events

Return a list of this site's events: every event name the site has tracked, plus any event you've set a currency for. Events are sorted by name, up to 1,000 per response. limit is ignored on this endpoint.

Identify events by name. Goal IDs were removed on 24 September 2026, so events no longer have an id. To page through a site with more than 1,000 events, pass the last event's name as starting_after.
currency is the currency you set with Set event currency, or null when the event uses your site's default. created_at is null for newer events.

Path parameters

site_idstringrequired
The ID of the site. This is the same string you use in your tracking code.
Example: CDBUGS

Query parameters

starting_afterstringoptional
An event name. Returns the events that come after it. Only needed when has_more is true.
ending_beforestringoptional
An event name. Returns the events that come before it. You can't send both starting_after and ending_before.

Returns

A list of event objects.

GET
curl "https://api.usefathom.com/v1/sites/CDBUGS/events" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
Response
{
    "object": "list",
    "url": "/v1/sites/CDBUGS/events",
    "has_more": false,
    "data": [
        {
            "object": "event",
            "name": "Purchased product",
            "currency": "pound",
            "created_at": "2020-08-21 15:24:00"
        },
        {
            "object": "event",
            "name": "Signed up to newsletter",
            "currency": null,
            "created_at": "2020-08-21 15:24:00"
        }
    ]
}

Set event currency#

POST/sites/{site_id}/events/currency

Set the currency of an event by its name. You can set it before the event is tracked for the first time: the currency applies as soon as the event arrives.

Path parameters

site_idstringrequired
The ID of the site. This is the same string you use in your tracking code.
Example: CDBUGS

Body parameters

namestringrequired
The name of the event (up to 255 characters).
Example: Purchase early access
currencystringrequired
The currency used for any value attached to this event's completions.
Optionsdollarpoundeuroyuanpesoshekelyenwonhryvniafrancrupeeintegernone

Returns

Returns an updated object on success. Otherwise, this call returns an error.

POST
curl -X POST "https://api.usefathom.com/v1/sites/CDBUGS/events/currency" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Purchase early access",
    "currency": "pound"
  }'
Response
{
    "object": "event",
    "name": "Purchase early access",
    "currency": "pound",
    "updated": true
}

Delete event#

DELETE/sites/{site_id}/events

Remove the currency you set for an event, so it goes back to your site's default currency. This doesn't delete the event's completion data, so the event still appears in List events while it has data. The call succeeds even if the event has no currency set.

Path parameters

site_idstringrequired
The ID of the site. This is the same string you use in your tracking code.
Example: CDBUGS

Query parameters

namestringrequired
The name of the event.
Example: Purchase early access

Returns

Returns a deleted object on success. Otherwise, this call returns an error.

DELETE
curl -X DELETE "https://api.usefathom.com/v1/sites/CDBUGS/events?name=Purchase%20early%20access" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
Response
{
    "object": "event",
    "name": "Purchase early access",
    "deleted": true
}

Get event#

Deprecated

GET/sites/{site_id}/events/{event_id}

This endpoint is no longer available

This endpoint is deprecated. It still works, but every response includes Deprecation and Sunset: Thu, 24 Sep 2026 23:59:59 GMT headers, so please move to List events.

Return a single event by its legacy goal code or its name. The id in the response echoes the value you sent.

Path parameters

site_idstringrequired
The ID of the site. This is the same string you use in your tracking code.
Example: CDBUGS
event_idstringrequired
The legacy goal code (tracking code) of the event, or the event name.
Example: ABCDEFGH

Returns

An event object.

Response
{
    "id": "ABCDEFGH",
    "object": "event",
    "name": "Signed up to newsletter",
    "currency": null,
    "created_at": "2020-08-21 15:24:00"
}

Create event#

Deprecated

POST/sites/{site_id}/events

This endpoint is no longer available

This endpoint was removed on 24 September 2026 and now returns 410 Gone. Track the event on your site, then use List events and Set event currency.

Previously created an event. 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

Body parameters

namestringrequired
The name of the event (up to 255 characters).
Example: Purchase early access
currencystringoptional
The currency used for any value attached to this event's completions. If omitted, defaults to dollar.
Default dollarOptionsdollarpoundeuroyuanpesoshekelyenwonhryvniafrancrupeeintegernone

Update event#

Deprecated

POST/sites/{site_id}/events/{event_id}

This endpoint is no longer available

This endpoint was removed on 24 September 2026 and now returns 410 Gone. To change an event's currency, use Set event currency.

Previously updated an event by its goal code. 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
event_idstringrequired
The id (tracking code) of the event you wish to update.
Example: ABCDEFGH

Body parameters

namestringoptional
The name of the event (up to 255 characters).
currencystringoptional
The currency used for any value attached to this event's completions.
Optionsdollarpoundeuroyuanpesoshekelyenwonhryvniafrancrupeeintegernone

Wipe event#

Deprecated

DELETE/sites/{site_id}/events/{event_id}/data

This endpoint is no longer available

This endpoint has been retired and now returns 410 Gone. It is no longer possible to wipe an event's completion data via the API.

Previously wiped all completion data belonging to an event. 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
event_idstringrequired
The id (tracking code) of the event.

Delete event#

Deprecated

DELETE/sites/{site_id}/events/{event_id}

This endpoint is no longer available

This endpoint was removed on 24 September 2026 and now returns 410 Gone. To delete an event, use Delete event with the event name.

Previously deleted an event by its goal code. 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
event_idstringrequired
The id (tracking code) of the event you wish to delete.