session_id on every event you capture for it.
Headers
| Header | Value | Required |
|---|---|---|
x-api-key | Your API key, sk_... | Yes |
Content-Type | application/json | Yes |
Body
| Field | Type | Required | Description |
|---|---|---|---|
session_id | UUID | Yes | Identifier for this conversation. Reuse it on every event in the conversation. |
user_data | object | Yes | Details about the end user. Must contain user_id. Additional traits are allowed (keep them pseudonymous). |
metadata | object | No | Free-form session-level metadata. Allowlist the keys you send. |
timestamp | integer (ms) | No | Epoch milliseconds for when the session started. Defaults to server time. |
client_config | string | No | A label for the client or SDK that produced the session. |
user_data
user_data must include a user_id. Any further keys are stored as traits on the user profile and become filterable dimensions in the dashboard.
| Field | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Pseudonymous end-user identifier. |
| …traits | any | No | Extra attributes such as plan or region. |
Request
Response
Generate
session_id on your side as a UUID so you can attach it to the events you send next. See POST /capture-event.