Skip to content

Events Endpoint

Submits a batch of analytics events for processing. SDKs should buffer events locally and flush them periodically rather than sending one event per request.

POST /events
{
"events": [
{
"type": "Evaluation",
"flagKey": "dark-mode",
"userId": "user-123",
"variation": "on",
"timestamp": "2026-02-16T15:30:00Z",
"metadata": {}
}
]
}
FieldTypeRequiredDescription
eventsSdkEventDto[]YesArray of events to record
FieldTypeRequiredDescription
typestringYesEvent type (see below)
flagKeystringYesAssociated flag key
userIdstringNoUser identifier
variationstringNoVariation key involved
timestampstringYesISO 8601 timestamp (UTC)
metadataobjectNoArbitrary key-value pairs
prerequisiteKeystringNoFor an Evaluation event whose reason is prerequisite-failed, the parent flag that gated it
reasonstringNoFor an Evaluation event, why that variation was served: rule-match, fallthrough, flag-disabled, prerequisite-failed, error or flag-not-found. Flag analytics uses it to show which part of the targeting served the traffic. Events without it count as an unknown source
ruleIdstringNoThe id of the targeting rule that matched, when reason is rule-match
TypeDescription
EvaluationA flag was evaluated
ImpressionA flag value was exposed to a user
IdentifyA user was identified
CustomA custom tracking event

Returns 202 Accepted with an empty body. Events are queued for asynchronous processing.

  • 401 Unauthorized — Invalid or missing SDK key.
  • Buffer events in memory and flush them on a timer (e.g., every 30 seconds) and when the buffer reaches a size threshold (e.g., 100 events).
  • Flush remaining events when the client is closed.
  • If a flush fails, retain the events and retry on the next interval.