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

# Get messages

> Get all messages in a conversation



## OpenAPI

````yaml /api-reference/openapi.json get /api/agents/conversations/{id}/messages
openapi: 3.0.0
info:
  title: Open Attack Surface Management
  description: Open-source platform for cybersecurity Attack Surface Management (ASM)
  version: '1.0'
  contact: {}
servers:
  - url: https://{baseUrl}/api/v1
    variables:
      baseUrl:
        default: localhost:3000
        description: API server hostname with port (e.g. localhost:3000, api.example.com)
security: []
tags: []
externalDocs:
  description: Authentication Docs
  url: auth/docs
paths:
  /api/agents/conversations/{id}/messages:
    get:
      tags:
        - Agents
      summary: Get messages
      description: Get all messages in a conversation
      operationId: AgentsController_getMessages
      parameters:
        - name: id
          required: true
          in: path
          description: Conversation ID
          schema:
            type: string
        - name: search
          required: false
          in: query
          schema:
            type: string
        - name: page
          required: false
          in: query
          schema:
            example: 1
            type: number
        - name: limit
          required: false
          in: query
          schema:
            example: 10
            type: number
        - name: sortBy
          required: false
          in: query
          schema:
            example: createdAt
            type: string
        - name: sortOrder
          required: false
          in: query
          schema:
            example: DESC
            type: string
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetManyMessageResponseDtoDto'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    GetManyMessageResponseDtoDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MessageResponseDto'
        total:
          type: number
        page:
          type: number
        limit:
          type: number
        hasNextPage:
          type: boolean
        pageCount:
          type: number
      required:
        - data
        - total
        - page
        - limit
        - hasNextPage
        - pageCount
    MessageResponseDto:
      type: object
      properties:
        id:
          type: string
        conversationId:
          type: string
        role:
          type: string
          enum:
            - user
            - assistant
            - system
        content:
          type: string
        messageType:
          type: string
          enum:
            - text
            - thinking
            - error
        metadata:
          type: object
        parts:
          type: array
          description: >-
            Chronological parts array preserving the real order of reasoning,
            tool calls, and text.
          items:
            type: object
        toolCalls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCallResponseDto'
        createdAt:
          format: date-time
          type: string
      required:
        - id
        - conversationId
        - role
        - content
        - messageType
        - createdAt
    ToolCallResponseDto:
      type: object
      properties:
        toolCallId:
          type: string
        toolName:
          type: string
        args:
          type: object
        result:
          type: object
        isError:
          type: boolean
          default: false
      required:
        - toolCallId
        - toolName
        - args

````