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

# List Chat Threads

> List all chat threads for a specific agent.



## OpenAPI

````yaml get /api/v1/chat/{agent_id}/threads
openapi: 3.1.0
info:
  title: ThenaAgentStudio
  description: |2-

        ThenaCrew AI CRM Renewal System

        An intelligent platform to automate customer renewal insights and communications through multi-agent workflows.

        Key Features:
        * AI-powered renewal analysis
        * Personalized communication generation
        * Automated opportunity tracking
        * Multi-agent workflow orchestration
        
  version: 1.0.0
servers:
  - url: https://agent-studio.thena.ai
    description: Production server
  - url: http://localhost:8008
    description: Local development server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management endpoints
  - name: Chat
    description: Chat and messaging endpoints
paths:
  /api/v1/chat/{agent_id}/threads:
    get:
      tags:
        - Chat
        - Chat
      summary: List Chat Threads
      description: List all chat threads for a specific agent.
      operationId: list_chat_threads_api_v1_chat__agent_id__threads_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Agent Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 1
            description: Number of threads to return
            default: 10
            title: Limit
          description: Number of threads to return
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of threads to skip
            default: 0
            title: Offset
          description: Number of threads to skip
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatThread'
                title: Response List Chat Threads Api V1 Chat  Agent Id  Threads Get
        '401':
          description: Unauthorized - Invalid or missing JWT token
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ChatThread:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        anon_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Anon User Id
        organization_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Organization Id
        title:
          type: string
          title: Title
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        messages:
          anyOf:
            - items:
                $ref: '#/components/schemas/ChatMessage'
              type: array
            - type: 'null'
          title: Messages
      type: object
      required:
        - agent_id
        - title
      title: ChatThread
      description: Model for chat threads.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChatMessage:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        thread_id:
          type: string
          format: uuid
          title: Thread Id
        content:
          type: string
          title: Content
        content_html:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Html
        role:
          type: string
          pattern: ^(user|assistant|system|tool)$
          title: Role
        tool_calls:
          anyOf:
            - items:
                $ref: '#/components/schemas/ToolCall'
              type: array
            - type: 'null'
          title: Tool Calls
        attachments:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Attachments
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        feedback:
          anyOf:
            - $ref: '#/components/schemas/backend__models__chat__ChatMessageFeedback'
            - type: 'null'
      type: object
      required:
        - thread_id
        - content
        - role
      title: ChatMessage
      description: Model for individual chat messages.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ToolCall:
      properties:
        tool_name:
          type: string
          title: Tool Name
        arguments:
          additionalProperties: true
          type: object
          title: Arguments
        result:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        start_time:
          type: string
          format: date-time
          title: Start Time
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Time
      type: object
      required:
        - tool_name
        - arguments
        - start_time
      title: ToolCall
      description: Model for tool/function calls made during chat.
    backend__models__chat__ChatMessageFeedback:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        human_message_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Human Message Id
        ai_message_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Ai Message Id
        flow_execution_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Flow Execution Id
        user_id:
          type: string
          format: uuid
          title: User Id
        organization_id:
          type: string
          format: uuid
          title: Organization Id
        feedback_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Feedback Type
        issue_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Issue Type
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - user_id
        - organization_id
      title: ChatMessageFeedback
      description: Simplified model for chat message feedback (excluding Portkey fields).
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````