Required roles
Personal API keys use their owner’s current role. Service-account keys use the account’s current role, not the role of the administrator who created the key. Most Sessions endpoints require Member, butGET /v1/sessions is Admin-only because it returns API sessions across the organization.
A request from an underprivileged key returns
403 Forbidden. If GET /v1/sessions fails, check the role of the personal key’s owner or the service account in Settings → Account management.
Follow-ups require the identity that owns the session. Keys belonging to the same service account share session ownership, so a replacement key can continue that account’s investigations. A key for a different account cannot send follow-ups to those sessions, even if both accounts belong to the same organization.
Investigation depth
BothPOST /v1/sessions and POST /v1/sessions/{session_id}/messages accept an optional thinking_mode field that sets how deeply Traversal investigates. See Investigation depth for guidance on choosing a mode.
Existing integrations that omit
thinking_mode use auto.
Session lifecycle
Investigations are asynchronous. Creating a session or sending a follow-up returns immediately, and Traversal investigates in the background. Connect toGET /v1/sessions/{session_id}/events to wait for a terminal status, then retrieve the result with GET /v1/sessions/{session_id}.
Status values
idle, failed, and cancelled are terminal statuses. When a session reaches one, no further work is in progress.
Status transitions
Stream status updates
The session events endpoint uses Server-Sent Events to report lifecycle changes without polling. Send the same bearer token you use for other API requests and requesttext/event-stream:
status event when you connect and whenever the status changes:
data value uses the same session shape as other Sessions endpoints, but messages is always null. Fetch GET /v1/sessions/{session_id} after the terminal event to retrieve the conversation and final result.
While the status remains running or follow_up_running, the server sends a : keepalive comment every 15 seconds when there is no status change. SSE clients ignore comment lines automatically. The stream closes after it sends an idle, failed, or cancelled status.
Python example
The following example creates an investigation, waits on the event stream, and retrieves the final messages:Polling fallback
If your HTTP client or network path does not support streaming responses, pollGET /v1/sessions/{session_id} at a steady interval until the session is no longer running or follow_up_running. A 5-second interval is a reasonable default.