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

# Fetch Messages For Agent



## OpenAPI

````yaml https://api.truestate.io/openapi.json get /conversations/{conversation_id}/messages-for-agent/
openapi: 3.1.0
info:
  title: TrueState Backend API
  summary: >-
    TrueState is an AI platform for business users to create high-impact AI
    solutions.
  description: >

    This **[TrueState](https://www.truestate.io/)** backend API allows our
    clients to automate and more powerfully retrieve and modify data from the
    TrueState platform.


    Example use cases include:


    - Accessing embeddings for a dataset.

    - Automating the process of dataset creation and model retraining as your
    data changes.

    - Much more.


    Our backend is built using the [FastAPI](https://fastapi.tiangolo.com/)
    framework in python

    using [Auth0](https://auth0.com/) and [Client API
    Keys](https://www.truestate.io/dawn/docs) for internal an external
    authentication, respectively.

    Our backend is designed to be secure, scalable, easy to use and well
    documented _(each router with its own linked docs page)_.

    Clients can only access data from their own organisation, as setup in Auth0
    our the Client API Keys. See how
    **[here](https://www.truestate.io/dawn/docs)**.


    **PS**: You can view this API documentation in either
    **[Swagger](swagger/docs)** or **[Redoc](redoc/)**, but only the swagger
    lets you test calls.
  contact:
    name: True State Support
    url: https://www.truestate.io/dawn/docs
    email: support@truestate.io
  license:
    name: Private
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.13.95
servers: []
security: []
paths:
  /conversations/{conversation_id}/messages-for-agent/:
    get:
      tags:
        - conversations
      summary: Fetch Messages For Agent
      operationId: >-
        fetch_messages_for_agent_conversations__conversation_id__messages_for_agent__get
      parameters:
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
            title: Conversation Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 50
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
        - name: Api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentMessagePage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AgentMessagePage:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/MessageResponse'
          type: array
          title: Messages
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        has_more:
          type: boolean
          title: Has More
          default: false
        message_count:
          type: integer
          title: Message Count
          default: 0
        character_count:
          type: integer
          title: Character Count
          default: 0
      type: object
      required:
        - messages
      title: AgentMessagePage
      description: Bounded model-visible conversation history returned to an agent.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MessageResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        member_id:
          type: string
          format: uuid
          title: Member Id
        sender_id:
          type: string
          title: Sender Id
        sender_type:
          type: string
          title: Sender Type
        message:
          type: string
          title: Message
        message_type:
          type: string
          title: Message Type
        conversation_id:
          type: string
          title: Conversation Id
        created_at:
          type: string
          format: date-time
          title: Created At
        is_finished:
          type: boolean
          title: Is Finished
        annotations:
          additionalProperties: true
          type: object
          title: Annotations
      type: object
      required:
        - id
        - member_id
        - sender_id
        - sender_type
        - message
        - message_type
        - conversation_id
        - created_at
        - is_finished
        - annotations
      title: MessageResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````