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

# Retrieve Session Threads

> Retrieves session threads for a given agent.

Fetch session threads for a specific agent.


## OpenAPI

````yaml GET /api/assistants/threads/{agentId}
openapi: 3.1.0
info:
  title: Session Thread API
  description: API for managing session threads.
  license:
    name: MIT
    identifier: ''
  version: 1.0.0
servers:
  - url: https://agent-service-511985928315.us-east4.run.app
security:
  - bearerAuth: []
    XEnvoleUserId: []
paths:
  /api/assistants/threads/{agentId}:
    get:
      summary: Retrieve session threads
      description: Retrieves session threads for a given agent.
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
        - name: active
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: A list of session threads.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SessionThreadResp'
              example:
                - id: thread_456
                  threadName: Project Ideas
                  agentId: agent_abc
                  agentName: Demo Agent
                  agentHandle: demo-agent
                  rootAgentBuildId: build_123
                  lastMessageTime: '2024-01-01T12:00:00Z'
                  sessionType: LIVE
        '204':
          description: No content.
        '400':
          description: Bad request.
        '500':
          description: Internal server error.
components:
  schemas:
    SessionThreadResp:
      type: object
      properties:
        id:
          type: string
        threadName:
          type: string
        agentId:
          type: string
        agentName:
          type: string
        agentHandle:
          type: string
        rootAgentBuildId:
          type: string
        lastMessageTime:
          type: string
          format: date-time
        sessionType:
          type: string
          enum:
            - LIVE
            - TESTING
      example:
        id: thread_456
        threadName: Project Ideas
        agentId: agent_abc
        agentName: Demo Agent
        agentHandle: demo-agent
        rootAgentBuildId: build_123
        lastMessageTime: '2024-01-01T12:00:00Z'
        sessionType: LIVE
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    XEnvoleUserId:
      type: apiKey
      in: header
      name: X-Envole-User-Id
      description: External user identifier; not necessarily registered with Envole

````