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

# List agent conversation threads

> <p> List the caller's agent conversations grouped by thread (most recently active first). Restore a thread's messages via the run events endpoints. </p> <p> Required scope: `inference:run` </p>




## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/qaip/openapi.documented.yml get /agent/threads
openapi: 3.0.3
info:
  title: QAIP APIs
  version: 1.0.0
servers:
  - url: https://developer.qaip.com/api/v1
    description: API base path
security:
  - ApiKeyAuth: []
tags:
  - name: completions
    description: Generate completions
  - name: search
    description: Search content
  - name: query
    description: Query materialized external tables
  - name: extract
    description: Data extraction using LLM
  - name: tags
    description: List available tags
  - name: agent
    description: (Experimental) Agent operations
  - name: tag-source-groups
    description: Tag and source group associations
  - name: source-groups
    description: Source group (job) management and metadata
  - name: sources
    description: Sources management and metadata
  - name: local-file-groups
    description: Local file group management
  - name: secrets
    description: Secret management
  - name: google-drives
    description: Google Drive data source management
  - name: google-drive-settings
    description: Google Drive data source setting management
  - name: crawls
    description: Web crawl data source management
  - name: crawl-settings
    description: Web crawl setting management
  - name: githubs
    description: GitHub data source management
  - name: github-settings
    description: GitHub data source setting management
  - name: notions
    description: Notion data source management
  - name: notion-settings
    description: Notion data source setting management
  - name: authz-subject-attributes
    description: >-
      Authorization subject attribute management (requires the `authz:grant`
      scope)
  - name: redaction-policies
    description: >-
      Tenant redaction policy management (requires the `policy:redaction:manage`
      scope)
  - name: api-keys
    description: API key issuance (requires the `apikeys:issue` scope)
paths:
  /agent/threads:
    get:
      tags:
        - agent
      summary: List agent conversation threads
      description: >
        <p> List the caller's agent conversations grouped by thread (most
        recently active first). Restore a thread's messages via the run events
        endpoints. </p> <p> Required scope: `inference:run` </p>
      operationId: listAgentThreads
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 200
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: principal_id
          in: query
          required: false
          description: >
            Filter by principal. If omitted, only threads with no principal
            (principal_id is null) are returned. Mutually exclusive with
            all_principals=true (400 if both are set).
          schema:
            type: string
        - name: all_principals
          in: query
          required: false
          description: >
            If true, return threads across all principals in the tenant.
            Mutually exclusive with principal_id (400 if both are set).
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Agent thread list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentThreadListResponse'
        '400':
          description: Bad Request (e.g. principal_id combined with all_principals=true)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AgentThreadListResponse:
      type: object
      required:
        - threads
      properties:
        threads:
          type: array
          items:
            $ref: '#/components/schemas/AgentThread'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              description: Human-readable error message
            type:
              type: string
              description: Machine-readable error code
    AgentThread:
      type: object
      required:
        - thread_id
        - agent_id
        - current_run_id
        - latest_run_id
        - status
      properties:
        thread_id:
          type: string
        principal_id:
          type: string
          nullable: true
          description: Authorization principal this thread belongs to (null if not set).
        agent_id:
          type: string
          format: uuid
          nullable: true
          description: Agent that owns the thread. Legacy rows may return null.
        current_run_id:
          type: string
          nullable: true
          description: >
            Authoritative continuation cursor for `delta_v1`. Send this value as

            `baseRunId`; legacy rows that have not been classified may return
            null.
        latest_run_id:
          type: string
          description: Most recently created run; not an authoritative continuation cursor.
        status:
          $ref: '#/components/schemas/AgentRunStatus'
        title:
          type: string
          nullable: true
        run_count:
          type: integer
        updated_at:
          type: string
          format: date-time
    AgentRunStatus:
      type: string
      description: Agent run lifecycle state.
      enum:
        - QUEUED
        - RUNNING
        - CANCELLING
        - SUCCEEDED
        - FAILED
        - CANCELLED
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````