Analytics

Export analytics

Queue a CSV or JSON export of your analytics and download it when the job finishes.

post/v1/analytics/export

Exporting analytics is asynchronous. This endpoint queues the work and returns a job ID immediately; the file appears once the job reports done.

Queue the export

POST /v1/analytics/export with the metrics, grouping, and date range you want. It returns a jobId.

Poll the job

GET /v1/jobs/get-by-id?jobId=… every few seconds until status is done.

Download the file

The finished job carries a url. Fetch it to get the CSV or JSON.

Exports are capped at 20 per day

This endpoint allows 3 requests per minute and 20 per day per account — a far tighter budget than the rest of the API. Retry deliberately; a loop that retries on every failure will exhaust the day's allowance in minutes.

Exports are scoped to your own account

accountId is required in the body, but the export always covers the account the API token belongs to.

Request body

accountIdstringrequired

Your account ID. Exports are always scoped to the account that owns the API token.

filterobjectrequired

Analytics filter object. An empty object exports everything in the date range.

metricsobject[]required
Show 2 properties
valuestringrequired
titlestringrequired
groupByobject[]required
Show 2 properties
valuestringrequired
titlestringrequired
segmentsobject[]
Show 2 properties
valuestringrequired
titlestringrequired
startDatestringrequired

First day of the range, as `YYYY-MM-DD`.

endDatestringrequired

Last day of the range, as `YYYY-MM-DD`.

formatenum

Output format. Defaults to `csv`.

One of: csv, json

Response · 200

okbooleanrequired
jobIdstringrequired

Poll this with the jobs endpoint until the export finishes.

fileNamestringrequired

Storage path the finished export is written to.

Example response

{
  "ok": true,
  "jobId": "JkLmNoPqRsTuVwXy",
  "fileName": "accounts/YOUR_ACCOUNT_ID/analytics/2026-08-11/JkLmNoPqRsTuVwXy.csv"
}

Errors: 400, 401, 404, 405, 429, 500. See Errors for the response shape.

postTry it
/v1/analytics/export

Stored in this browser tab only. Requests go directly to the API — the token never reaches the docs site.

Add a token to send a request.

https://api.superfunnel.ai/v1/analytics/export

curl -X POST 'https://api.superfunnel.ai/v1/analytics/export' \
  -H 'x-api-key: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"accountId":"YOUR_ACCOUNT_ID","filter":{},"metrics":[{"value":"uniqueVisitors","title":"Unique visitors"}],"groupBy":[{"value":"campaign","title":"Campaign"}],"startDate":"2026-07-01","endDate":"2026-07-31","format":"csv"}'