Analytics
Analytics events are captured for a wide range of card activity and user actions. There are four ways to extract these analytics from Atomic:
- Batched data
- Recent data
- Workbench
- Webhooks
Atomic provides the ability to download analytic events from the previous 30 days directly in the Workbench. We also provide two API endpoints which allow analytics events to be retrieved from the Atomic Platform.

Backup and storage
Analytics are stored in Atomic for the amount of time defined in an organization's data retention settings.
Atomic is not a long-term storage solution. If you wish to store Analytic data for a long-term (i.e. longer than a year) then you should use the APIs as documented in this page to retrieve the data and store it in your own solution. The recommended pattern is to poll the batched analytics API to download and copy analytics out.
Batched data analytics via API
See Atomic's public API specification for more specific details about the analytics/batched endpoint.
Analytics data is processed in hourly batches, and available for retrieval as CSV, newline-delimited JSON or Parquet from the Atomic API. Batches are available at most one hour after their period ends. The default format is newline-delimited JSON, if none is specified.
Batches contain Atomic analytics events only. Your custom events are not included, in any of the three formats. To retrieve them, use recent analytics via API, a webhook, or the analytics debugger.
A time range may be specified via the from and to parameters, which are timestamps in ISO8601 format. Note that data is processed hourly, so it isn't possible to retrieve a partial hour. When creating the date range, the from parameter is rounded down to the nearest hour, and to is rounded up. The maximum allowed date range is 30 days.
GET /v1/:environmentId/analytics/batched?from=<timestamp>&to=<timestamp>&format=<ndjson | parquet | csv>
The API response contains an array of pre-signed urls pointing to the data files for the specified period, these URLS expire after 15 minutes. The files are grouped by hour ended in UTC, using the format YYYY-MM-DDTHH - for example, the batch for March 27 2020, 1-2am will be under 2020-03-27T02. Note the file array for an hour will only appear here once it is finished processing. If the file array is empty, it means there were no analytics events for that period.
For example, to retrieve all analytics data for the 27th of March 2020:
GET /v1/:environmentId/analytics/batched?from=2020-03-27T00:00:00Z&to=2020-03-28T00:00:00Z&format=parquet
Response:
{
"data": {
"2020-03-27T01": ["https://data.atomic.io/path-to/file.parquet?signature=..."],
"2020-03-27T02": ["https://data.atomic.io/path-to/file.parquet?signature=..."],
...
"2020-03-28T00": ["https://data.atomic.io/path-to/file.parquet?signature=..."],
}
}
Note that url parameters may be localized, but the response format will always use UTC.
Newline-delimited JSON format
Files contain one analytics object, in json format matching the schema, per line. For example
{"id": "...", "analyticsEvent": "card-published", "endUserId": "...", "timestamp": "...", "eventContext": { ... }, ...}
{"id": "...", "analyticsEvent": "card-published", "endUserId": "...", "timestamp": "...", "eventContext": { ... }, ...}
{"id": "...", "analyticsEvent": "card-published", "endUserId": "...", "timestamp": "...", "eventContext": { ... }, ...}
Parquet format
Each record in the parquet file has the keys in the schema flattened.
Recent analytics via API
See Atomic's public API specification for more specific details about the analytics endpoint.
Another endpoint is available to retrieve non-batched analytics. Data for the last 7 days may be retrieved in JSON format, with the oldest data returned first. The from and to parameters are timestamps in ISO8601 format. The analytics in the API response can be further filtered with the following query parameters:
- cardTemplateId
- eventName (can be a single event or comma separated list i.e.
card-completedorcard-completed,card-snoozed) - endUserId
- flowConfigId
- flowInvocationId
- desc (order newest to oldest, providing any value in this parameter will enable this)
- limit (default 1000, max 5000)
Analytic events are written to Atomic's datastore from a queue based system. As such, at times of high usage there may be a delay in writing analytic events and therefore also a delay in retrieving them from this endpoint. Typically such a delay would not be more than a few minutes. Due to this, we recommend, if polling this endpoint, to leave a buffer between the current time and the time you are querying for of at-least a few minutes.
Atomic does not recommend polling this endpoint to retrieve all of your analytic events, the batched analytics endpoint is more fault tolerant and recommended.
GET /v1/:environmentId/analytics?from=<timestamp>&to=<timestamp>
The additional query parameters listed above are optional, they can be used like so:
GET /v1/:environmentId/analytics?from=<timestamp>&to=<timestamp>&cardTemplateId=<your-card-template>&limit=3000
Response format:
{
"data": {
"events": [
{ ... },
{ ... },
...
],
"count": 100, // number of events returned in this payload
"cursor": "..." // used for pagination
}
}
Pagination
When you make a request to get events a cursor property is returned. To get the next page of results, use the cursor query parameter with the value returned from your last request to get the next page i.e. cursor={cursor from previous request}.