Skip to main content
POST
Capture session
Call once per conversation. Reuse session_id on every event that follows.

Body

For production data-handling guidance, see Data Governance.

Verify

After creating a session and sending at least one event, open Raw logs in Agnost and confirm the session_id appears on the event.

Troubleshooting

  • session_id must be a UUID.
  • user_data.user_id is required.
  • Reuse the same session_id for every event in the conversation.

Headers

x-org-id
string
required

Your organization ID (UUID, case-insensitive).

Example:

"<org-id>"

Body

application/json
session_id
string<uuid>
required

Session UUID. Reuse on every event in this conversation.

Example:

"a3f9c182-7d4e-4b6a-9e21-c5d8f0b4e731"

user_data
object
required

End-user identity. user_id is required; other traits are supported for analytics. The example shows shape, but production integrations should prefer a stable pseudonymous ID and avoid raw email, name, phone, or other personal data unless explicitly approved.

Example:
metadata
object

Free-form session metadata. Prefer allowlisted operational fields; do not send secrets or sensitive personal data.

Example:
timestamp
integer<int64>

Unix time in ms when the session began. Defaults to server time.

Example:

1714867200000

client_config
string

Free-form client/SDK label.

Example:

"client-segment-001"

Response

Session created

session_id
string