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

# List messages

> Retrieve paginated list of messages with optional filters



## OpenAPI

````yaml GET /messages
openapi: 3.0.3
info:
  title: NativeMessage API
  version: 1.0.0
  description: Complete API documentation for NativeMessage platform
  contact:
    name: NativeMessage Support
    email: support@nativemessage.com
servers:
  - url: https://api-message.nativehub.live/api/v1
    description: Production server
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /messages:
    get:
      tags:
        - Messages
      summary: List messages
      description: Retrieve paginated list of messages with optional filters
      operationId: listMessages
      parameters:
        - $ref: '#/components/parameters/PageParam'
        - $ref: '#/components/parameters/PerPageParam'
        - name: status
          in: query
          description: Filter by message status
          schema:
            type: string
            enum:
              - pending
              - queued
              - submitted
              - delivered
              - failed
              - rejected
              - expired
        - name: from
          in: query
          description: Filter by sender
          schema:
            type: string
        - name: to
          in: query
          description: Filter by recipient
          schema:
            type: string
        - name: date_from
          in: query
          description: Filter messages from this date
          schema:
            type: string
            format: date
        - name: date_to
          in: query
          description: Filter messages until this date
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Messages retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMessages'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    PageParam:
      name: page
      in: query
      description: Page number (default 1)
      schema:
        type: integer
        default: 1
        minimum: 1
    PerPageParam:
      name: per_page
      in: query
      description: Items per page (default 20, max 100)
      schema:
        type: integer
        default: 20
        minimum: 1
        maximum: 100
  schemas:
    PaginatedMessages:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Message'
        total:
          type: integer
        page:
          type: integer
        per_page:
          type: integer
      example:
        data:
          - id: d4e5f6a7-b8c9-0123-def4-567890123456
            tenant_id: c3d4e5f6-a7b8-9012-cdef-123456789012
            account_id: b2c3d4e5-f6a7-8901-bcde-f12345678901
            user_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
            from: '+8801912345678'
            to: '+8801712345678'
            body: Your OTP is 123456
            status: delivered
            part_count: 1
            sell_price: 0.05
            cost_price: 0.03
            is_encrypted: false
            sent_at: '2026-02-14T10:15:30Z'
            delivered_at: '2026-02-14T10:15:32Z'
            created_at: '2026-02-14T10:15:28Z'
            updated_at: '2026-02-14T10:15:32Z'
        total: 1543
        page: 1
        per_page: 20
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      example:
        error: Invalid request parameters
    Message:
      type: object
      properties:
        id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        account_id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        batch_id:
          type: string
          format: uuid
        from:
          type: string
        to:
          type: string
        body:
          type: string
        status:
          type: string
          enum:
            - pending
            - queued
            - submitted
            - delivered
            - failed
            - rejected
            - expired
        part_count:
          type: integer
        sell_price:
          type: number
        cost_price:
          type: number
        connection_id:
          type: string
          format: uuid
        provider_message_id:
          type: string
        priority:
          type: string
        is_encrypted:
          type: boolean
        error_code:
          type: string
        error_message:
          type: string
        sent_at:
          type: string
          format: date-time
        delivered_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      example:
        id: d4e5f6a7-b8c9-0123-def4-567890123456
        tenant_id: c3d4e5f6-a7b8-9012-cdef-123456789012
        account_id: b2c3d4e5-f6a7-8901-bcde-f12345678901
        user_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        batch_id: e5f6a7b8-c9d0-1234-ef56-789012345678
        from: '+8801912345678'
        to: '+8801712345678'
        body: Your OTP is 123456. Valid for 5 minutes.
        status: delivered
        part_count: 1
        sell_price: 0.05
        cost_price: 0.03
        connection_id: f6a7b8c9-d0e1-2345-fa67-890123456789
        provider_message_id: sm_abc123xyz
        priority: normal
        is_encrypted: false
        sent_at: '2026-02-14T10:15:30Z'
        delivered_at: '2026-02-14T10:15:32Z'
        created_at: '2026-02-14T10:15:28Z'
        updated_at: '2026-02-14T10:15:32Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````