The V1 Sessions API must be explicitly enabled for your organization. If your organization does not yet have access, contact your Traversal point of contact or support@traversal.com.
Endpoints
See the Endpoints section in the sidebar for the full API reference, generated from the OpenAPI spec.Required roles
API keys inherit the role of the user who created them. Most Sessions endpoints work for anymember, but GET /v1/sessions is admin-only because it returns sessions across the whole organization.
A request from an underprivileged key returns
403 Forbidden with a message naming the required role. If GET /v1/sessions is failing for you, check the role of the user who issued the key in Settings > User Management.
Investigation depth
BothPOST /v1/sessions and POST /v1/sessions/{session_id}/messages accept an optional thinking_mode field that controls how much depth Traversal applies:
If omitted,
thinking_mode defaults to auto, so existing integrations need no changes.
Session lifecycle
Investigations are asynchronous. Creating a session or sending a follow-up returns immediately while 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. Once the session reaches one of these states, 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.