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

FieldNotes
typetrack (default), page or identify
eventThe event name, for track (up to 200 characters)
nameAn optional page name, for page (default page_viewed)
messageIdYour ID for the message; repeats are counted once
timestampWhen it happened (ISO 8601); up to 5 years back and 1 day ahead. Default: now
userId, anonymousId, externalIdAt least one; externalId is { kind, value }
propertiesAn object, up to 32 KB
traits, setOnce, increment, unsetChanges to the person's traits (see Events, properties and traits)
contextpage { url, path, title, referrer, search }, utm, click_ids, consent, locale, …

Response and errors

200 OK
{ "object": "ingest_result", "accepted": 3, "duplicates": 0, "suppressed": 0, "rejected": 1,
  "errors": [{ "index": 2, "message": "event name is required (up to 200 characters)" }] }
StatusCodeWhen
401missing_write_keyNo key was sent
400invalid_bodyThe body isn't a message or a batch of them
400invalid_jsonThe body isn't valid JSON
400empty_batchThe batch has no messages
400invalid_batchThe batch isn't an array of messages
401invalid_write_keyThe key is wrong, rolled or its source archived
403analytics_disabledAnalytics is off for the account
403domain_not_allowedA 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
413body_too_largeThe body is over 512 KB
413batch_too_largeOver 500 messages in one batch
429rate_limitedA limit was reached (below); the message says which. Don't retry in a loop
500internal_errorSomething 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

LimitApplies toResets
60,000 messages a minuteEach sourceEvery minute
1,000,000 live messages a dayEach source (ask us to raise it)Midnight UTC
10,000 test messages a dayThe whole account, every test key togetherMidnight UTC
The plan's live eventsThe 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 refusedEach 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
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"}}]}'
200 OK
{ "object": "counts_result", "accepted": 1, "rejected": 0, "errors": [] }