Track an event
POST/v1/events/track
Requires an API key with the events:write scope. About keys and scopes
Works with integration and partner keys, not agent keys.
Send Idempotency-Key. A retry with the same key and body repeats nothing. Most writes replay the first response; a transactional send returns the message as it stands now. About idempotency
Records a behavioural event against a contact. Events drive journey triggers and segment rules, so this is the main ingestion endpoint for product activity. The event and its processing obligation are stored atomically: a 201 confirms storage, while journey and conversion effects run asynchronously afterwards. Name the contact by exactly one of contactId, externalId or email; a contact that does not exist is a 404, never created: identify it first. occurredAt defaults to now and may be at most 24 hours in the future; an event that arrives more than 72 hours after its occurredAt starts no journey, but still counts for history, exits and waits. Names are case-sensitive, up to 128 characters with no control characters, with leading and trailing spaces removed; those beginning with contact. are reserved for platform events. A workspace tracks at most 1,000 distinct names: a new one past that is refused with EVENT_NAME_LIMIT_REACHED, so keep ids and prices in properties. Send an Idempotency-Key from your own event id: without one, every request records a new event, so a retry after a timeout can record it twice and start a journey twice. A repeated Idempotency-Key with the same body returns the receipt first stored, with Idempotency-Replay: true; with a different body it is a 409 IDEMPOTENCY_KEY_REUSED. The body must be JSON (Content-Type: application/json). Each event counts against the plan's monthly events: past the allowance, Free refuses it with 403 PLAN_LIMIT_REACHED; a paid plan draws on the prepaid balance, then a tolerance, then refuses it the same way.
Header parameters
Idempotency-KeystringoptionalMakes a retry safe for as long as what the request created exists: a repeat with the same key and body gets the first response again, with
Idempotency-Replay: true. The same key with another request is 409IDEMPOTENCY_KEY_REUSED. Use a new key, such as a UUID, for each new request.8–255 characters
Kirora-WorkspacestringoptionalPartner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.
pattern
^[A-Za-z0-9._:-]{1,128}$
Request body
Any of 3 shapes:
- By contact id
5 child attributes
contactIdstringrequiredKirora's id for the contact.
uuid
namestringrequiredCase-sensitive, up to 128 characters once leading and trailing spaces are removed.
contact.*is reserved, andOrdered Productis recorded from eachOrder Completed.pattern
^\P{Cc}+$· 1–128 characterspropertiesmap<string, any>optionalFree-form details of the event; at most 16 KB, keys up to 64 characters,
productsup to 250 lines.default
{}occurredAtstringoptionalWhen it happened; defaults to now. At most 24 hours ahead.
date-time
contextEventContextInputoptionalWhere and on what it happened, beside the properties.
12 child attributes
sessionIdstringoptionalThe visit, from the SDK.
up to 128 characters
localestringoptionalAs BCP 47,
en-GB; extensions such as-u-fw-monare dropped.timezonestringoptionalAs IANA,
Europe/Berlin.up to 64 characters
pageobjectoptionalWeb: the page as visited: query strings kept, fragments removed. A longer value is cut, not refused:
url,searchandreferrerat 8192 characters,pathat 2048,titleat 256.5 child attributes
urlstringoptionalThe canonical URL if the page has one, with the page's query string added unless it has its own; else the page's address.
pathstringoptionalsearchstringoptionalThe visited address's query string,
?plan=pro; empty or absent when it has none.titlestringoptionalreferrerstringoptional
campaignobjectoptionalWeb: the
utm_*parameters of the page, each cut to 256 characters.5 child attributes
sourcestringoptionalmediumstringoptionalnamestringoptionaltermstringoptionalcontentstringoptional
deviceobjectoptional3 child attributes
idstringoptionalA random id the SDK keeps on the device; never a hardware id.
up to 128 characters
manufacturerstringoptionalMobile:
Apple,Samsung.up to 64 characters
typestringoptionalMobile:
iosorandroid.up to 32 characters
appobjectoptionalMobile: the app the event happened in.
4 child attributes
namestringoptionalup to 256 characters
versionstringoptionalAs the app shows it,
2.4.0.up to 64 characters
buildstringoptionalThe build number,
412.up to 64 characters
namespacestringoptionalThe bundle id (iOS) or package name (Android).
up to 256 characters
osobjectoptionalMobile: the operating system.
2 child attributes
namestringoptionaliOS,Android.up to 64 characters
versionstringoptional17.4.1.up to 64 characters
screenobjectoptionalMobile: the screen in points (iOS) or pixels (Android), and its scale.
3 child attributes
widthintegeroptionalmin > 0 · max 100000
heightintegeroptionalmin > 0 · max 100000
densitynumberoptionalmin > 0 · max 10
libraryobjectoptional2 child attributes
namestringoptionalup to 64 characters
versionstringoptionalup to 64 characters
ipstringoptionalup to 64 characters
userAgentstringoptionalup to 1,024 characters
- By external id
5 child attributes
externalIdstringrequiredYour own id for the contact, as set with identify.
1–255 characters
namestringrequiredCase-sensitive, up to 128 characters once leading and trailing spaces are removed.
contact.*is reserved, andOrdered Productis recorded from eachOrder Completed.pattern
^\P{Cc}+$· 1–128 characterspropertiesmap<string, any>optionalFree-form details of the event; at most 16 KB, keys up to 64 characters,
productsup to 250 lines.default
{}occurredAtstringoptionalWhen it happened; defaults to now. At most 24 hours ahead.
date-time
contextEventContextInputoptionalWhere and on what it happened, beside the properties.
12 child attributes
sessionIdstringoptionalThe visit, from the SDK.
up to 128 characters
localestringoptionalAs BCP 47,
en-GB; extensions such as-u-fw-monare dropped.timezonestringoptionalAs IANA,
Europe/Berlin.up to 64 characters
pageobjectoptionalWeb: the page as visited: query strings kept, fragments removed. A longer value is cut, not refused:
url,searchandreferrerat 8192 characters,pathat 2048,titleat 256.5 child attributes
urlstringoptionalThe canonical URL if the page has one, with the page's query string added unless it has its own; else the page's address.
pathstringoptionalsearchstringoptionalThe visited address's query string,
?plan=pro; empty or absent when it has none.titlestringoptionalreferrerstringoptional
campaignobjectoptionalWeb: the
utm_*parameters of the page, each cut to 256 characters.5 child attributes
sourcestringoptionalmediumstringoptionalnamestringoptionaltermstringoptionalcontentstringoptional
deviceobjectoptional3 child attributes
idstringoptionalA random id the SDK keeps on the device; never a hardware id.
up to 128 characters
manufacturerstringoptionalMobile:
Apple,Samsung.up to 64 characters
typestringoptionalMobile:
iosorandroid.up to 32 characters
appobjectoptionalMobile: the app the event happened in.
4 child attributes
namestringoptionalup to 256 characters
versionstringoptionalAs the app shows it,
2.4.0.up to 64 characters
buildstringoptionalThe build number,
412.up to 64 characters
namespacestringoptionalThe bundle id (iOS) or package name (Android).
up to 256 characters
osobjectoptionalMobile: the operating system.
2 child attributes
namestringoptionaliOS,Android.up to 64 characters
versionstringoptional17.4.1.up to 64 characters
screenobjectoptionalMobile: the screen in points (iOS) or pixels (Android), and its scale.
3 child attributes
widthintegeroptionalmin > 0 · max 100000
heightintegeroptionalmin > 0 · max 100000
densitynumberoptionalmin > 0 · max 10
libraryobjectoptional2 child attributes
namestringoptionalup to 64 characters
versionstringoptionalup to 64 characters
ipstringoptionalup to 64 characters
userAgentstringoptionalup to 1,024 characters
- By email
5 child attributes
emailstringrequiredThe contact's email address, matched trimmed and without case.
namestringrequiredCase-sensitive, up to 128 characters once leading and trailing spaces are removed.
contact.*is reserved, andOrdered Productis recorded from eachOrder Completed.pattern
^\P{Cc}+$· 1–128 characterspropertiesmap<string, any>optionalFree-form details of the event; at most 16 KB, keys up to 64 characters,
productsup to 250 lines.default
{}occurredAtstringoptionalWhen it happened; defaults to now. At most 24 hours ahead.
date-time
contextEventContextInputoptionalWhere and on what it happened, beside the properties.
12 child attributes
sessionIdstringoptionalThe visit, from the SDK.
up to 128 characters
localestringoptionalAs BCP 47,
en-GB; extensions such as-u-fw-monare dropped.timezonestringoptionalAs IANA,
Europe/Berlin.up to 64 characters
pageobjectoptionalWeb: the page as visited: query strings kept, fragments removed. A longer value is cut, not refused:
url,searchandreferrerat 8192 characters,pathat 2048,titleat 256.5 child attributes
urlstringoptionalThe canonical URL if the page has one, with the page's query string added unless it has its own; else the page's address.
pathstringoptionalsearchstringoptionalThe visited address's query string,
?plan=pro; empty or absent when it has none.titlestringoptionalreferrerstringoptional
campaignobjectoptionalWeb: the
utm_*parameters of the page, each cut to 256 characters.5 child attributes
sourcestringoptionalmediumstringoptionalnamestringoptionaltermstringoptionalcontentstringoptional
deviceobjectoptional3 child attributes
idstringoptionalA random id the SDK keeps on the device; never a hardware id.
up to 128 characters
manufacturerstringoptionalMobile:
Apple,Samsung.up to 64 characters
typestringoptionalMobile:
iosorandroid.up to 32 characters
appobjectoptionalMobile: the app the event happened in.
4 child attributes
namestringoptionalup to 256 characters
versionstringoptionalAs the app shows it,
2.4.0.up to 64 characters
buildstringoptionalThe build number,
412.up to 64 characters
namespacestringoptionalThe bundle id (iOS) or package name (Android).
up to 256 characters
osobjectoptionalMobile: the operating system.
2 child attributes
namestringoptionaliOS,Android.up to 64 characters
versionstringoptional17.4.1.up to 64 characters
screenobjectoptionalMobile: the screen in points (iOS) or pixels (Android), and its scale.
3 child attributes
widthintegeroptionalmin > 0 · max 100000
heightintegeroptionalmin > 0 · max 100000
densitynumberoptionalmin > 0 · max 10
libraryobjectoptional2 child attributes
namestringoptionalup to 64 characters
versionstringoptionalup to 64 characters
ipstringoptionalup to 64 characters
userAgentstringoptionalup to 1,024 characters
Returns
Returns 201 Created with a TrackedEvent in data. It can also return 409 Conflict, 413 Payload Too Large or 415 Unsupported Media Type; see the statuses below. Otherwise returns an error; Errors lists every code and which to retry.
201 CreatedThe event was recorded: its id and theoccurredAtit was stored with, a receipt rather than the event.409 ConflictThe request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.413 Payload Too LargeThe body is larger than this operation accepts (PAYLOAD_TOO_LARGE).415 Unsupported Media TypeThe body is not JSON, or not the upload the operation takes (UNSUPPORTED_MEDIA_TYPE).
idstringrequireduuid
occurredAtstringrequireddate-time
expiresAtstringrequiredWhen retention deletes it: when it happened plus the days the plan kept events when it was stored. Fixed: a plan change moves only later events.
date-time
Headers on 201 Created
Idempotency-Replaystringoptionaltruewhen this is the stored response to an earlier request with the same key.one of
true