Track an event

Records a single event from a browser or server SDK using the workspace write key, then queues it for enrichment and delivery.

Request

This endpoint expects an object.
event_idstringRequired

Unique event ID (ULID)

event_namestringRequired

Event name (page_view, order_completed, etc.)

event_timedoubleRequired

Event timestamp (Unix seconds)

anonymous_idstringRequired
Anonymous visitor ID
schema_version"1"OptionalDefaults to 1
Schema version
user_idstring or nullOptional
Known user ID after identify
traitsobject or nullOptional

User traits (email, phone, etc.)

contextobject or nullOptional
Event context.
consentobject or nullOptional
Google Consent Mode v2.
propertiesmap from strings to any or nullOptional
Event properties
test_modebooleanOptionalDefaults to false
Whether event is in test mode

Response

Successful Response
okbooleanDefaults to true
event_idstring or null
duplicatebooleanDefaults to false

Errors

422
Unprocessable Entity Error