Skip to main content
POST
Send up to 100 identify and track items in one request; the JavaScript SDK sends every call this way. A batch is taken whole or not at all: one refused item refuses the request, and nothing of it is stored.
An item that names a userId needs the Maqetin-Identity-Token header in required mode, the default, unless you send the batch with a secret key. See Identity verification.

Limits

Headers

string
required
Bearer mq_live_…, your public key, or Bearer mq_sec_…, a secret key with the events:write scope. A secret key without that scope is a 401.
string
A token your server signed for the person the batch names. One token covers the request, so every item with a userId must name the token’s sub. A batch sent with a secret key needs no token. See Identity token.

Body

Any top-level field that is not listed here is a 400.
object[]
required
1 to 100 items. Each has a type and follows the rules of that call.
string
When your client sent the request, as an ISO 8601 date-time. Send it once, on the batch: an item cannot carry its own sentAt. See Event time.

Response

number
required
The number of events taken: every item of the batch.
A 202 means the batch is stored. A refusal has error and, for a body problem, at, which points into the batch, such as /batch or /batch/2. See Errors.