> ## 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.

# List sessions

> Returns sessions created via the V1 API, scoped to the authenticated
caller's organization. Sessions created in the web app are not included.

**Requires the `admin` role.** Personal keys use their owner's role;
service-account keys use the account's role. Member-role keys can call
the other Sessions endpoints, subject to session ownership requirements.
This endpoint returns API sessions across the organization, so calls
from a member-role key return `403 Forbidden`.

If `page` and `limit` are both omitted, all sessions are returned in a
single response.




## OpenAPI

````yaml /api/openapi.yaml get /v1/sessions
openapi: 3.1.0
info:
  title: Traversal API
  version: 1.0.0
  description: |
    The Traversal V1 API lets you launch investigations, manage the
    customer-authored knowledge files that agents use, and read the
    organization audit trail.

    All endpoints require a Bearer token. The authenticated user must have at
    least the `member` role within the organization unless an endpoint states
    otherwise.

    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.
  - name: Knowledge Files
    description: List, upload, download, and delete customer-authored agent knowledge.
  - name: Event Logs
    description: Read the organization's audit trail. Admin-only.
paths:
  /v1/sessions:
    get:
      tags:
        - Sessions
      summary: List sessions
      description: |
        Returns sessions created via the V1 API, scoped to the authenticated
        caller's organization. Sessions created in the web app are not included.

        **Requires the `admin` role.** Personal keys use their owner's role;
        service-account keys use the account's role. Member-role keys can call
        the other Sessions endpoints, subject to session ownership requirements.
        This endpoint returns API sessions across the organization, so calls
        from a member-role key return `403 Forbidden`.

        If `page` and `limit` are both omitted, all sessions are returned in a
        single response.
      operationId: listSessions
      parameters:
        - name: page
          in: query
          required: false
          description: Page number (1-indexed).
          schema:
            type: integer
            minimum: 1
        - name: limit
          in: query
          required: false
          description: Number of sessions per page.
          schema:
            type: integer
            minimum: 1
      responses:
        '200':
          description: A page of sessions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    SessionList:
      type: object
      required:
        - sessions
        - count
        - total
      properties:
        sessions:
          type: array
          description: Sessions on the current page.
          items:
            $ref: '#/components/schemas/Session'
        count:
          type: integer
          description: Number of sessions on this page.
        prev:
          type:
            - integer
            - 'null'
          description: Previous page number. `null` if first page.
        next:
          type:
            - integer
            - 'null'
          description: Next page number. `null` if last page.
        total:
          type: integer
          description: Total sessions across all pages.
    Session:
      type: object
      required:
        - id
        - status
        - input
        - created_at
      properties:
        id:
          type: string
          format: uuid
          description: Unique session identifier.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        status:
          $ref: '#/components/schemas/SessionStatus'
        title:
          type:
            - string
            - 'null'
          description: Human-readable session title.
          example: Elevated error rate in checkout service
        input:
          type: string
          description: The original incident description or question.
          example: >-
            Our checkout service started returning 500 errors at
            2024-03-15T14:30:00Z. Error rate jumped from 0.1% to 15%.
        created_at:
          type: string
          format: date-time
          description: When the session was created (UTC).
          example: '2024-03-15T14:35:00Z'
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the session was last updated (UTC).
          example: '2024-03-15T14:38:12Z'
        messages:
          type:
            - array
            - 'null'
          description: >-
            Conversation history. Only populated on `GET
            /v1/sessions/{session_id}`.
          items:
            $ref: '#/components/schemas/Message'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - conflict
                - internal
                - invalid_argument
                - not_found
                - payload_too_large
                - permission_denied
                - precondition_failed
                - resource_exhausted
                - unauthenticated
                - unavailable
                - unsupported_media_type
              description: Stable machine-readable error category.
            message:
              type: string
              description: Human-readable explanation of the error.
            retry_after:
              type: integer
              description: |
                Optional suggested seconds to wait before retrying. Present
                only when the server can recommend a delay, such as some `429`
                and `503` responses. When set, the response also includes a
                standard `Retry-After` HTTP header with the same value.
    SessionStatus:
      type: string
      enum:
        - running
        - idle
        - follow_up_running
        - failed
        - cancelled
      description: |
        - `running` — a new investigation is in progress.
        - `idle` — investigation is complete and ready for follow-ups.
        - `follow_up_running` — a follow-up message is being processed.
        - `failed` — the investigation or follow-up errored or timed out.
        - `cancelled` — the investigation was cancelled.
    Message:
      type: object
      required:
        - id
        - role
        - markdown_content
        - created_at
      properties:
        id:
          type: string
          description: Unique message identifier.
          example: msg-001-uuid
        role:
          type: string
          enum:
            - user
            - assistant
          description: The author of the message.
        markdown_content:
          type: string
          description: Message content in Markdown.
          example: |-
            ## Investigation Summary

            I investigated the elevated error rate...
        created_at:
          type: string
          format: date-time
          description: When the message was created (UTC).
          example: '2024-03-15T14:38:12Z'
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: Authentication challenge (`Bearer`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Insufficient role, ownership, permission, or endpoint-specific access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    MethodNotAllowed:
      description: >-
        The path exists but does not support the requested HTTP method. Uses the
        `invalid_argument` error code.
      headers:
        Allow:
          schema:
            type: string
          description: Comma-separated HTTP methods supported by the path.
      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'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Bearer token in the `Authorization` header — for example,
        `Authorization: Bearer YOUR_API_KEY`. Personal keys act as their owner;
        the Sessions API also accepts organization-owned service-account keys.
        Knowledge Files endpoints currently require a personal key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.