Track an eventMenu

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-Keystringoptional

Makes 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 409 IDEMPOTENCY_KEY_REUSED. Use a new key, such as a UUID, for each new request.

8–255 characters

Kirora-Workspacestringoptional

Partner 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
contactIdstringrequired

Kirora's id for the contact.

uuid

namestringrequired

Case-sensitive, up to 128 characters once leading and trailing spaces are removed. contact.* is reserved, and Ordered Product is recorded from each Order Completed.

pattern ^\P{Cc}+$ · 1–128 characters

propertiesmap<string, any>optional

Free-form details of the event; at most 16 KB, keys up to 64 characters, products up to 250 lines.

default {}

occurredAtstringoptional

When it happened; defaults to now. At most 24 hours ahead.

date-time

contextEventContextInputoptional

Where and on what it happened, beside the properties.

12 child attributes
sessionIdstringoptional

The visit, from the SDK.

up to 128 characters

localestringoptional

As BCP 47, en-GB; extensions such as -u-fw-mon are dropped.

timezonestringoptional

As IANA, Europe/Berlin.

up to 64 characters

pageobjectoptional

Web: the page as visited: query strings kept, fragments removed. A longer value is cut, not refused: url, search and referrer at 8192 characters, path at 2048, title at 256.

5 child attributes
urlstringoptional

The canonical URL if the page has one, with the page's query string added unless it has its own; else the page's address.

pathstringoptional
searchstringoptional

The visited address's query string, ?plan=pro; empty or absent when it has none.

titlestringoptional
referrerstringoptional
campaignobjectoptional

Web: the utm_* parameters of the page, each cut to 256 characters.

5 child attributes
sourcestringoptional
mediumstringoptional
namestringoptional
termstringoptional
contentstringoptional
deviceobjectoptional
3 child attributes
idstringoptional

A random id the SDK keeps on the device; never a hardware id.

up to 128 characters

manufacturerstringoptional

Mobile: Apple, Samsung.

up to 64 characters

typestringoptional

Mobile: ios or android.

up to 32 characters

appobjectoptional

Mobile: the app the event happened in.

4 child attributes
namestringoptional

up to 256 characters

versionstringoptional

As the app shows it, 2.4.0.

up to 64 characters

buildstringoptional

The build number, 412.

up to 64 characters

namespacestringoptional

The bundle id (iOS) or package name (Android).

up to 256 characters

osobjectoptional

Mobile: the operating system.

2 child attributes
namestringoptional

iOS, Android.

up to 64 characters

versionstringoptional

17.4.1.

up to 64 characters

screenobjectoptional

Mobile: the screen in points (iOS) or pixels (Android), and its scale.

3 child attributes
widthintegeroptional

min > 0 · max 100000

heightintegeroptional

min > 0 · max 100000

densitynumberoptional

min > 0 · max 10

libraryobjectoptional
2 child attributes
namestringoptional

up to 64 characters

versionstringoptional

up to 64 characters

ipstringoptional

up to 64 characters

userAgentstringoptional

up to 1,024 characters

By external id
5 child attributes
externalIdstringrequired

Your own id for the contact, as set with identify.

1–255 characters

namestringrequired

Case-sensitive, up to 128 characters once leading and trailing spaces are removed. contact.* is reserved, and Ordered Product is recorded from each Order Completed.

pattern ^\P{Cc}+$ · 1–128 characters

propertiesmap<string, any>optional

Free-form details of the event; at most 16 KB, keys up to 64 characters, products up to 250 lines.

default {}

occurredAtstringoptional

When it happened; defaults to now. At most 24 hours ahead.

date-time

contextEventContextInputoptional

Where and on what it happened, beside the properties.

12 child attributes
sessionIdstringoptional

The visit, from the SDK.

up to 128 characters

localestringoptional

As BCP 47, en-GB; extensions such as -u-fw-mon are dropped.

timezonestringoptional

As IANA, Europe/Berlin.

up to 64 characters

pageobjectoptional

Web: the page as visited: query strings kept, fragments removed. A longer value is cut, not refused: url, search and referrer at 8192 characters, path at 2048, title at 256.

5 child attributes
urlstringoptional

The canonical URL if the page has one, with the page's query string added unless it has its own; else the page's address.

pathstringoptional
searchstringoptional

The visited address's query string, ?plan=pro; empty or absent when it has none.

titlestringoptional
referrerstringoptional
campaignobjectoptional

Web: the utm_* parameters of the page, each cut to 256 characters.

5 child attributes
sourcestringoptional
mediumstringoptional
namestringoptional
termstringoptional
contentstringoptional
deviceobjectoptional
3 child attributes
idstringoptional

A random id the SDK keeps on the device; never a hardware id.

up to 128 characters

manufacturerstringoptional

Mobile: Apple, Samsung.

up to 64 characters

typestringoptional

Mobile: ios or android.

up to 32 characters

appobjectoptional

Mobile: the app the event happened in.

4 child attributes
namestringoptional

up to 256 characters

versionstringoptional

As the app shows it, 2.4.0.

up to 64 characters

buildstringoptional

The build number, 412.

up to 64 characters

namespacestringoptional

The bundle id (iOS) or package name (Android).

up to 256 characters

osobjectoptional

Mobile: the operating system.

2 child attributes
namestringoptional

iOS, Android.

up to 64 characters

versionstringoptional

17.4.1.

up to 64 characters

screenobjectoptional

Mobile: the screen in points (iOS) or pixels (Android), and its scale.

3 child attributes
widthintegeroptional

min > 0 · max 100000

heightintegeroptional

min > 0 · max 100000

densitynumberoptional

min > 0 · max 10

libraryobjectoptional
2 child attributes
namestringoptional

up to 64 characters

versionstringoptional

up to 64 characters

ipstringoptional

up to 64 characters

userAgentstringoptional

up to 1,024 characters

By email
5 child attributes
emailstringrequired

The contact's email address, matched trimmed and without case.

namestringrequired

Case-sensitive, up to 128 characters once leading and trailing spaces are removed. contact.* is reserved, and Ordered Product is recorded from each Order Completed.

pattern ^\P{Cc}+$ · 1–128 characters

propertiesmap<string, any>optional

Free-form details of the event; at most 16 KB, keys up to 64 characters, products up to 250 lines.

default {}

occurredAtstringoptional

When it happened; defaults to now. At most 24 hours ahead.

date-time

contextEventContextInputoptional

Where and on what it happened, beside the properties.

12 child attributes
sessionIdstringoptional

The visit, from the SDK.

up to 128 characters

localestringoptional

As BCP 47, en-GB; extensions such as -u-fw-mon are dropped.

timezonestringoptional

As IANA, Europe/Berlin.

up to 64 characters

pageobjectoptional

Web: the page as visited: query strings kept, fragments removed. A longer value is cut, not refused: url, search and referrer at 8192 characters, path at 2048, title at 256.

5 child attributes
urlstringoptional

The canonical URL if the page has one, with the page's query string added unless it has its own; else the page's address.

pathstringoptional
searchstringoptional

The visited address's query string, ?plan=pro; empty or absent when it has none.

titlestringoptional
referrerstringoptional
campaignobjectoptional

Web: the utm_* parameters of the page, each cut to 256 characters.

5 child attributes
sourcestringoptional
mediumstringoptional
namestringoptional
termstringoptional
contentstringoptional
deviceobjectoptional
3 child attributes
idstringoptional

A random id the SDK keeps on the device; never a hardware id.

up to 128 characters

manufacturerstringoptional

Mobile: Apple, Samsung.

up to 64 characters

typestringoptional

Mobile: ios or android.

up to 32 characters

appobjectoptional

Mobile: the app the event happened in.

4 child attributes
namestringoptional

up to 256 characters

versionstringoptional

As the app shows it, 2.4.0.

up to 64 characters

buildstringoptional

The build number, 412.

up to 64 characters

namespacestringoptional

The bundle id (iOS) or package name (Android).

up to 256 characters

osobjectoptional

Mobile: the operating system.

2 child attributes
namestringoptional

iOS, Android.

up to 64 characters

versionstringoptional

17.4.1.

up to 64 characters

screenobjectoptional

Mobile: the screen in points (iOS) or pixels (Android), and its scale.

3 child attributes
widthintegeroptional

min > 0 · max 100000

heightintegeroptional

min > 0 · max 100000

densitynumberoptional

min > 0 · max 10

libraryobjectoptional
2 child attributes
namestringoptional

up to 64 characters

versionstringoptional

up to 64 characters

ipstringoptional

up to 64 characters

userAgentstringoptional

up 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 the occurredAt it 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).
idstringrequired

uuid

occurredAtstringrequired

date-time

expiresAtstringrequired

When 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-Replaystringoptional

true when this is the stored response to an earlier request with the same key.

one of true