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

# List Messages

> List messages in the current workspace.



## OpenAPI

````yaml api-reference/openapi.json get /api/v1/messages
openapi: 3.1.0
info:
  title: FastAPI app
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/messages:
    get:
      tags:
        - Messages
      summary: List Messages
      description: List messages in the current workspace.
      operationId: list_messages_api_v1_messages_get
      parameters:
        - name: conversation_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by conversation ID
            title: Conversation Id
          description: Filter by conversation ID
        - name: sender_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by sender ID
            title: Sender Id
          description: Filter by sender ID
        - name: role
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by message role
            title: Role
          description: Filter by message role
        - name: message_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by message type
            title: Message Type
          description: Filter by message type
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search messages by content
            title: Search
          description: Search messages by content
        - name: tags
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by tags (comma-separated)
            title: Tags
          description: Filter by tags (comma-separated)
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of messages to skip
            default: 0
            title: Skip
          description: Number of messages to skip
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Number of messages to return
            default: 100
            title: Limit
          description: Number of messages to return
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: Field to order by
            default: created_at
            title: Order By
          description: Field to order by
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            description: Order direction (asc/desc)
            default: desc
            title: Order Direction
          description: Order direction (asc/desc)
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The workspace ID
            title: X-Workspace-Id
          description: The workspace ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_MessageRead_'
        '404':
          description: Message not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - DualAuthScheme: []
components:
  schemas:
    PaginatedResponse_MessageRead_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/MessageRead'
          type: array
          title: Data
        total_count:
          type: integer
          title: Total Count
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
        next_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Page
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        has_more:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has More
      type: object
      required:
        - data
        - total_count
      title: PaginatedResponse[MessageRead]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MessageRead:
      properties:
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
        conversation_id:
          type: string
          title: Conversation Id
          description: Reference to conversation
        sender_id:
          type: string
          title: Sender Id
          description: ID of the message sender
        role:
          type: string
          title: Role
          description: Message role (user, assistant, system, etc.)
          default: user
        content:
          type: string
          title: Content
          description: Message content
        tool_calls:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tool Calls
          description: Tool calls made in this message
        message_type:
          type: string
          title: Message Type
          description: Type of message
          default: text
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Message tags
        checksum:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum
          description: Message checksum
        attachments:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Attachments
          description: Message attachments
        parent_message_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Message Id
          description: Parent message ID for threading
        meta_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta Data
          description: Additional metadata
        sent_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sent At
          description: When the message was sent
        owner_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Id
          description: Owner ID
        workspace_id:
          type: string
          title: Workspace Id
          description: Reference to workspace
      type: object
      required:
        - conversation_id
        - sender_id
        - content
        - workspace_id
      title: MessageRead
      description: Schema for reading message data.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    DualAuthScheme:
      type: http
      scheme: bearer

````