> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traversal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream session status

> Opens a Server-Sent Events (SSE) stream for a session. The stream sends
a `status` event immediately after connecting and whenever the session
status changes. Each event's `data` field contains a session snapshot
with `messages: null`.

While the session remains `running` or `follow_up_running`, the server
sends a `: keepalive` comment every 15 seconds when no status change
occurs. SSE clients ignore comments automatically.

The stream closes after sending an `idle`, `failed`, or `cancelled`
status. After receiving a terminal status, retrieve the final
conversation with `GET /v1/sessions/{session_id}`.

If the connection closes before a terminal status arrives, reconnect
to this endpoint. The first event always reports the current status, so
clients do not need an event cursor or `Last-Event-ID` header.




## OpenAPI

````yaml /api/openapi.yaml get /v1/sessions/{session_id}/events
openapi: 3.1.0
info:
  title: Traversal Sessions API
  version: 1.0.0
  description: >
    The V1 Sessions API lets you launch investigations, send follow-up
    questions,

    and retrieve results programmatically. Sessions are the same investigation

    primitive that powers the Traversal web application.


    All endpoints require a Bearer token. The authenticated user must have at

    least the `MEMBER` role within the organization, and the V1 API must be

    enabled for that organization — otherwise endpoints return `403 Forbidden`.


    To wait for an investigation without polling, connect to

    `GET /v1/sessions/{session_id}/events`. The Server-Sent Events stream sends

    session status snapshots and closes when the session reaches a terminal

    status.
servers:
  - url: https://api.traversal.com
    description: Traversal API
security:
  - bearerAuth: []
tags:
  - name: Sessions
    description: Create, list, retrieve, and continue investigation sessions.
paths:
  /v1/sessions/{session_id}/events:
    get:
      tags:
        - Sessions
      summary: Stream session status
      description: |
        Opens a Server-Sent Events (SSE) stream for a session. The stream sends
        a `status` event immediately after connecting and whenever the session
        status changes. Each event's `data` field contains a session snapshot
        with `messages: null`.

        While the session remains `running` or `follow_up_running`, the server
        sends a `: keepalive` comment every 15 seconds when no status change
        occurs. SSE clients ignore comments automatically.

        The stream closes after sending an `idle`, `failed`, or `cancelled`
        status. After receiving a terminal status, retrieve the final
        conversation with `GET /v1/sessions/{session_id}`.

        If the connection closes before a terminal status arrives, reconnect
        to this endpoint. The first event always reports the current status, so
        clients do not need an event cursor or `Last-Event-ID` header.
      operationId: streamSessionEvents
      parameters:
        - $ref: '#/components/parameters/SessionId'
      responses:
        '200':
          description: Session status event stream.
          headers:
            Cache-Control:
              description: >-
                Prevents caches and proxies from transforming or buffering the
                stream.
              schema:
                type: string
                example: no-cache, no-transform
            X-Accel-Buffering:
              description: Disables response buffering in compatible reverse proxies.
              schema:
                type: string
                example: 'no'
          content:
            text/event-stream:
              schema:
                type: string
              example: >
                event: status

                data:
                {"id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","status":"running","title":"Elevated
                error rate in checkout service","input":"Our checkout service
                started returning 500
                errors.","created_at":"2026-08-10T14:35:00Z","updated_at":"2026-08-10T14:35:00Z","messages":null}


                : keepalive


                event: status

                data:
                {"id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","status":"idle","title":"Elevated
                error rate in checkout service","input":"Our checkout service
                started returning 500
                errors.","created_at":"2026-08-10T14:35:00Z","updated_at":"2026-08-10T14:38:12Z","messages":null}
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    SessionId:
      name: session_id
      in: path
      required: true
      description: The unique identifier of the session.
      schema:
        type: string
        format: uuid
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        V1 API not enabled for the organization, or the authenticated user has
        insufficient role.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Session does not exist or does not belong to your organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            message:
              type: string
              description: Human-readable explanation of the error.
            retry_after:
              type:
                - integer
                - 'null'
              description: |
                Suggested seconds to wait before retrying. Present on `429`
                and `409` responses. When set, the response also includes a
                standard `Retry-After` HTTP header with the same value.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Bearer token in the `Authorization` header — for example,
        `Authorization: Bearer trv_ak_your_api_key_here`. Each key is bound to a
        specific user and organization.

````