Skip to main content
POST
Track records one event, and a journey can start on it. Send event, channel and a userId, an anonymousId or both; a visitor who has not signed in has only anonymousId.
A call that names a userId needs the Maqetin-Identity-Token header in required mode, the default. A call with only an anonymousId needs none. See Identity verification.

Headers

string
required
Bearer mq_live_…, your public key. A secret key is refused here: send events with a secret key to /v1/batch.
string
A token your server signed for this userId. See Identity token.

Body

The body is at most 32 KiB. Any other top-level field is a 400.
string
required
The name of the event, at least 1 character. See Name events.
string
required
Where the call came from: web, ios, android, node, python, go or rest. Use rest for your own HTTP calls.
string
Your own id for the person, 1 to 256 characters. Required when there is no anonymousId.
string
The id of a visitor who has not signed in, 1 to 256 characters. Required when there is no userId.
object
default:"{}"
What you know about the event. Any JSON values. Property names cannot hold the NUL character.
string
1 to 64 characters. A retry with the same id is stored once. See Send an event once.
string
When it happened, as an ISO 8601 date-time. Used only together with sentAt. See Event time.
string
When your client sent the request, as an ISO 8601 date-time.
string
The id of the session, at most 256 characters.
string
The version of the SDK that made the call.
object
Where the event was made. The SDK fills it for you. Same rules as the context of Identify.

Name events

Name an event object.action, lower case and past tense, such as order.placed. The object is the part before the first dot. The gateway takes any name that is not empty, so the convention is yours to keep. Ten objects belong to Maqetin; do not use them for events of your own (the SDK sends page.viewed itself): app, install, deeplink, screen, page, push, in_app, link, message and email.

Response

number
required
The number of events taken: 1.
A 202 means the event is stored. A refusal has error and, for a body problem, at. See Errors.