Analytics
Collect API reference
POST /api/v1/collect and /api/v1/counts: authentication, message fields, limits and errors.
Request
POST /api/v1/collect with JSON or text/plain (for sendBeacon). Authenticate with the source's write key as a Bearer token, or writeKey in the body: its test key sends test data, its live key live data. Send { batch: [...] } (up to 500 messages and 512 KB) or a single message. Any origin may call it with a test key. A website source's live key is accepted only from a browser (an Origin header) on one of the source's listed domains; from a server, use a server source's live key, which needs no origin.
Message fields
| Field | Notes |
|---|---|
type | track (default), page or identify |
event | The event name, for track (up to 200 characters) |
name | An optional page name, for page (default page_viewed) |
messageId | Your ID for the message; repeats are counted once |
timestamp | When it happened (ISO 8601); up to 5 years back and 1 day ahead. Default: now |
userId, anonymousId, externalId | At least one; externalId is { kind, value } |
properties | An object, up to 32 KB |
traits, setOnce, increment, unset | Changes to the person's traits (see Events, properties and traits) |
context | page { url, path, title, referrer, search }, utm, click_ids, consent, locale, … |
Response and errors
{ "object": "ingest_result", "accepted": 3, "duplicates": 0, "suppressed": 0, "rejected": 1,
"errors": [{ "index": 2, "message": "event name is required (up to 200 characters)" }] }| Status | Code | When |
|---|---|---|
| 401 | missing_write_key | No key was sent |
| 400 | invalid_body | The body isn't a message or a batch of them |
| 400 | invalid_json | The body isn't valid JSON |
| 400 | empty_batch | The batch has no messages |
| 400 | invalid_batch | The batch isn't an array of messages |
| 401 | invalid_write_key | The key is wrong, rolled or its source archived |
| 403 | analytics_disabled | Analytics is off for the account |
| 403 | domain_not_allowed | A website's live key sent without a browser origin, from a site that isn't one of the source's domains, or before the source lists its domains; use the test key there, or a server source |
| 413 | body_too_large | The body is over 512 KB |
| 413 | batch_too_large | Over 500 messages in one batch |
| 429 | rate_limited | A limit was reached (below); the message says which. Don't retry in a loop |
| 500 | internal_error | Something went wrong on our side; retry with the same messageIds |
Errors have a type, a code, a message and a link to these docs. Rejected messages don't stop the rest of the batch.
Limits
| Limit | Applies to | Resets |
|---|---|---|
| 60,000 messages a minute | Each source | Every minute |
| 1,000,000 live messages a day | Each source (ask us to raise it) | Midnight UTC |
| 10,000 test messages a day | The whole account, every test key together | Midnight UTC |
| The plan's live events | The account: Free's 100k a month, the trial's 1M, or a plan's included events plus what the spending cap buys. Past it, live events are refused | Each calendar month (Free) or billing period, or when the cap is raised |
Past any of them, requests get 429 with a message naming the limit; test data keeps working when live is paused. See billing and plans.
Counts
POST /api/v1/counts takes daily totals a source knows only as numbers (ad impressions, reach, letters mailed), with the same key, batch shape, limits and errors. Each count is event, date (YYYY-MM-DD), count (a whole number from 0) and optional properties. Sending the same day, event and properties again replaces the count, so a nightly sync can resend the last few days safely.
curl https://incrementality.ai/api/v1/counts \
-H "Authorization: Bearer $INCREMENTALITY_WRITE_KEY" \
-H "Content-Type: application/json" \
-d '{"batch":[{"event":"ad_impression","date":"2026-10-01","count":25000,
"properties":{"campaign":"Spring sale","creative":"Video A"}}]}'{ "object": "counts_result", "accepted": 1, "rejected": 0, "errors": [] }