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

# List agent conversations

> Returns a paginated list of conversations belonging to the agent.



## OpenAPI

````yaml /openapi.yaml get /agents/{agentId}/conversations
openapi: 3.0.3
info:
  title: ReyGrid API
  version: 1.0.3
  description: |
    ReyGrid API

    ## Persistent user conversations

    If you want to build a separate conversation system for each user,
    build a wrapper layer around the ReyGrid API.

    The wrapper should manage the application's own user IDs and map them
    to ReyGrid conversations.

    The wrapper is responsible for:
    - Managing and identifying users.
    - Storing the relationship between the application's userId and
      ReyGrid conversationId.
    - Persisting conversation IDs in the application's own database.
    - Reusing the stored conversationId when the same user continues
      a conversation.
    - Verifying that conversation IDs belong to the expected user before
      using them.

    ReyGrid's userId can also be used as a stable identifier for persistent
    conversations. However, if the application requires its own user and
    conversation management, it should maintain this mapping in its own
    database.
servers:
  - url: https://reygrid.com/api/v1
security: []
paths:
  /agents/{agentId}/conversations:
    get:
      summary: List agent conversations
      description: Returns a paginated list of conversations belonging to the agent.
      operationId: listAgentConversations
      parameters:
        - name: agentId
          in: path
          required: true
          description: The ID of the agent.
          schema:
            type: string
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Size'
      responses:
        '200':
          description: Paginated list of conversations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationsResponse'
              example:
                success: true
                conversations:
                  - userId: user_42
                    messagesCount: 14
                    createdAt: '2026-10-04T08:15:02.000Z'
                    expiresAt: '2026-10-19T08:15:02.000Z'
                  - conversationId: conv_cCJ7WLoKF4Sd4d2vjv8k
                    messagesCount: 2
                    createdAt: '2026-10-02T12:10:42.525Z'
                    expiresAt: '2026-10-17T12:10:42.522Z'
                pagination:
                  totalConversations: 54
                  totalPages: 3
                  currentPage: 1
                  pagingCounter: 1
                  hasNextPage: true
        '401':
          description: API key is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
      security:
        - apiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl
            "https://reygrid.com/api/v1/agents/{AgentId}/conversations?page=1&size=20"
            \
              -H "Authorization: Bearer $REYGRID_API_KEY"
        - lang: python
          label: Python SDK
          source: |-
            from reygrid import ReyGrid

            client = ReyGrid(api_key="YOUR_API_KEY")

            for page in client.paginate_conversations("{AgentId}"):
                for convo in page.data:
                    print(convo.conversationId or convo.userId, convo.messagesCount)
        - lang: javascript
          label: TypeScript SDK
          source: >-
            import { ReyGrid } from "reygrid";


            const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });


            for await (const page of
            client.paginateConversations("{AgentId}").pages()) {
              for (const convo of page.data) console.log(convo.conversationId ?? convo.userId, convo.messagesCount);
            }
components:
  parameters:
    Page:
      name: page
      in: query
      required: false
      description: Page number.
      schema:
        type: integer
        minimum: 1
        default: 1
    Size:
      name: size
      in: query
      required: false
      description: Number of items per page.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
  schemas:
    ConversationsResponse:
      type: object
      required:
        - success
        - conversations
        - pagination
      properties:
        success:
          type: boolean
        conversations:
          type: array
          items:
            $ref: '#/components/schemas/Conversation'
        pagination:
          $ref: '#/components/schemas/ConversationsPagination'
    AuthErrorResponse:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
          example: Unauthorized
        code:
          type: string
          example: AUTH_REQUIRED
    Conversation:
      type: object
      properties:
        conversationId:
          type: string
        userId:
          type: string
        messagesCount:
          type: integer
        expiresAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
    ConversationsPagination:
      allOf:
        - $ref: '#/components/schemas/Pagination'
        - type: object
          required:
            - totalConversations
          properties:
            totalConversations:
              type: integer
    Pagination:
      type: object
      required:
        - totalPages
        - currentPage
        - pagingCounter
        - hasNextPage
      properties:
        totalPages:
          type: integer
        currentPage:
          type: integer
        pagingCounter:
          type: integer
        hasNextPage:
          type: boolean
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API-Key
      description: ReyGrid API key sent as a Bearer token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.