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

# Get Agent Conversations

> Retrieve all information about an agent's conversations.

### Response Headers for Pagination

| Header Name          | Type    | Description                                   |
| -------------------- | ------- | --------------------------------------------- |
| `X-Page-Size`        | integer | The number of items per page.                 |
| `X-Start-After`      | string  | The ID of the last item on the previous page. |
| `X-Next-Start-After` | string  | The ID of the last item on the current page.  |
| `X-Total-Count`      | integer | The total number of items.                    |

These headers are included in the response to help manage pagination when retrieving conversations for a specific agent.


## OpenAPI

````yaml GET /api/v1/agents/{agentId}/conversations
openapi: 3.1.0
info:
  title: PlayAI API
  version: 1.0.0
  description: |
    A single, combined OpenAPI specification that merges:
      • PlayAI Agent API
      • PlayAI PlayNote API
      • PlayAI Text-to-Speech (TTS) API
      • PlayAI Dialog Turbo API

    This file contains all endpoints, schemas, and components 
    from the four original specs. See "Merged Issues" below 
    for notes on how certain conflicts were resolved.
servers:
  - url: https://api.play.ai
security:
  - ApiKeyAuth: []
    XUserIdAuth: []
paths:
  /api/v1/agents/{agentId}/conversations:
    get:
      description: Get all conversations for an agent.
      parameters:
        - name: agentId
          in: path
          description: The agent's ID.
          required: true
          schema:
            $ref: '#/components/schemas/AgentId'
        - name: pageSize
          in: query
          description: The number of items to return per page.
          required: false
          schema:
            type: integer
            default: 50
        - name: startAfter
          in: query
          description: The conversation ID to start after.
          required: false
          schema:
            type: string
        - name: accept
          in: header
          required: false
          schema:
            type: string
            enum:
              - application/json
      responses:
        '200':
          description: Conversations retrieved.
          headers:
            X-Page-Size:
              $ref: '#/components/headers/X-Page-Size'
            X-Start-After:
              $ref: '#/components/headers/X-Start-After'
            X-Next-Start-After:
              $ref: '#/components/headers/X-Next-Start-After'
            X-Total-Count:
              $ref: '#/components/headers/X-Total-Count'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConversationResource'
      security:
        - ApiKeyAuth: []
          XUserIdAuth: []
components:
  schemas:
    AgentId:
      description: The unique ID for each agent.
      type: string
      example: f0gZrOKBKL7veJ6o1M
    ConversationResource:
      type: object
      properties:
        id:
          type: string
          example: tIKQo8GMvOZyGx0Wm2RT
        source:
          type: string
          example: web
        callerEmail:
          type: string
          example: test@gmail.com
        startedAt:
          type: string
          format: date-time
          example: '2024-06-04T15:13:53.687Z'
        endedAt:
          type: string
          format: date-time
          example: '2024-06-04T15:18:54.687Z'
        durationInSeconds:
          type: integer
          example: 301
  headers:
    X-Page-Size:
      description: The number of items per page.
      schema:
        type: integer
    X-Start-After:
      description: The ID of the last item on the previous page.
      schema:
        type: string
    X-Next-Start-After:
      description: The ID of the last item on the current page.
      schema:
        type: string
    X-Total-Count:
      description: The total number of items.
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >
        Your secret API key from [PlayAI](https://play.ai/api/keys), formatted
        as `Bearer YOUR_SECRET_API_KEY`.
    XUserIdAuth:
      type: apiKey
      in: header
      name: X-USER-ID
      description: |
        Your unique user ID from [PlayAI](https://play.ai/api/keys).
      x-prompt: What is your PlayAI user ID?

````