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

# Get chats

> Returns a list of chats. Can be filtered by agentId and/or jobId query parameters.



## OpenAPI

````yaml https://interact.turntwo.com/api/openapi.json get /api/agents/chats
openapi: 3.0.0
info:
  title: Turntwo Interact API
  description: API for managing agent jobs, chats, and triggering job executions
  version: 1.0.0
servers:
  - url: https://interact.turntwo.com
    description: Production server
security: []
tags:
  - name: Jobs
    description: Agent job management endpoints
  - name: Chats
    description: Agent chat endpoints
paths:
  /api/agents/chats:
    get:
      tags:
        - Chats
      summary: Get chats
      description: >-
        Returns a list of chats. Can be filtered by agentId and/or jobId query
        parameters.
      parameters:
        - name: agentId
          in: query
          required: false
          schema:
            type: string
          description: Optional filter by Agent ID
        - name: jobId
          in: query
          required: false
          schema:
            type: string
          description: Optional filter by Job ID
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatsResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - Missing required permission or access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found - Agent job not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
          OrganizationId: []
components:
  schemas:
    ChatsResponse:
      type: object
      properties:
        chats:
          type: array
          items:
            $ref: '#/components/schemas/Chat'
      required:
        - chats
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    Chat:
      type: object
      properties:
        id:
          type: string
          description: Chat ID
        status:
          type: string
          description: Chat status
        initiator:
          type: string
          description: Who initiated the chat
        createdAt:
          type: string
          format: date-time
          description: Chat creation timestamp
        agent:
          $ref: '#/components/schemas/Agent'
          description: Agent information (only present when agentId filter is not used)
        job:
          $ref: '#/components/schemas/JobInfo'
          description: Job information
      required:
        - id
        - status
        - initiator
        - createdAt
        - job
    Agent:
      type: object
      properties:
        id:
          type: string
          description: Agent ID
        name:
          type: string
          nullable: true
          description: Agent name
      required:
        - id
    JobInfo:
      type: object
      properties:
        id:
          type: string
          nullable: true
          description: Job ID
        name:
          type: string
          nullable: true
          description: Job name
      required:
        - id
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication
    OrganizationId:
      type: apiKey
      in: header
      name: X-Organization-Id
      description: Organization ID associated with the API key

````