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

# List messages

> Lists the messages of the project, newest first, with cursor pagination. Filter by `direction` to see only inbound or only outbound messages.

On a number connected in coexistence mode, the list includes the messages the business sent from the WhatsApp Business app (`origin: business_app`) and the imported history. A message whose content is older than your plan retains comes with `content: null` and `content_redacted_at`.



## OpenAPI

````yaml en/openapi.json GET /v1/messages
openapi: 3.0.3
info:
  title: Routa API
  description: >-
    REST API to send and receive WhatsApp messages, track delivery and receive
    normalized events through webhooks.
  version: '1'
servers:
  - url: https://api.routa.chat
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Send, retrieve and list messages.
  - name: Events
    description: Query the log of normalized events.
  - name: Webhooks
    description: Manage webhook endpoints, secrets and deliveries.
  - name: Templates
    description: Create and retrieve WhatsApp templates.
  - name: Media
    description: Upload and download media files.
  - name: Usage
    description: Query the metered usage of the project.
  - name: Identity
    description: Identify the API key in use.
  - name: Partners
    description: >-
      Create one project per customer, issue the key of each project, follow the
      channels and receive the events of every customer on a single webhook.
      These routes use a partner key (`rt_partner_...`). See [Partner
      API](/en/partners/overview).
paths:
  /v1/messages:
    get:
      tags:
        - Messages
      summary: List messages
      description: >-
        Lists the messages of the project, newest first, with cursor pagination.
        Filter by `direction` to see only inbound or only outbound messages.


        On a number connected in coexistence mode, the list includes the
        messages the business sent from the WhatsApp Business app (`origin:
        business_app`) and the imported history. A message whose content is
        older than your plan retains comes with `content: null` and
        `content_redacted_at`.
      operationId: listMessages
      parameters:
        - schema:
            type: string
            enum:
              - inbound
              - outbound
          in: query
          name: direction
          required: false
          description: >-
            Filters by message direction: `inbound` (received) or `outbound`
            (sent).
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          in: query
          name: limit
          required: false
          description: Number of items per page, from 1 to 100. The default is 20.
        - schema:
            type: string
          in: query
          name: cursor
          required: false
          description: The `next_cursor` value of the previous page. Treat it as opaque.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageList'
        '401':
          description: >-
            The API key is missing, invalid, revoked or expired
            (`api_key_invalid`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key lacks the required scope (`insufficient_scope`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded. See the `Retry-After` header
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth:
            - messages:read
components:
  schemas:
    MessageList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          description: Messages on this page.
        has_more:
          type: boolean
          description: Whether there are more pages.
        next_cursor:
          type: string
          nullable: true
          description: Cursor of the next page, or `null` on the last one.
      required:
        - data
        - has_more
        - next_cursor
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              description: >-
                Error category: `invalid_request_error`, `authentication_error`,
                `permission_error`, `not_found_error`, `conflict_error`,
                `rate_limit_error`, `billing_error` or `api_error`.
              example: invalid_request_error
            code:
              type: string
              description: >-
                Stable, machine-readable code. See [Error
                codes](/en/errors/error-codes).
              example: channel_inactive
            message:
              type: string
              description: >-
                Human-readable text, in English. It can change, so do not parse
                it.
              example: Channel chan_01J8... is not active and cannot send messages.
            param:
              type: string
              description: >-
                The request field at fault, when it applies. It is filled in on
                `request_invalid` (the field outside the schema, such as
                `template.button_parameters.0.index`) and on template errors:
                `name` in `template_name_invalid`; `body_text`,
                `components.header`, `components.footer` or `components.buttons`
                in `template_components_invalid`; and `variable_examples`,
                `variable_examples.<position>`, `components.header.example` or
                `components.buttons.<position>.example` when
                `template_variables_invalid` refuses an example.
              example: components.buttons.0.example
            doc_url:
              type: string
              description: Link to the documentation of the code, when available.
            details:
              type: object
              additionalProperties:
                oneOf:
                  - type: string
                  - type: number
              description: >-
                Actionable values, such as `limit`, `used` and `resets_at` in
                `message_quota_exceeded`, or `reason`, which tells apart the
                causes behind one code, in errors such as `invalid_recipient`
                and `template_variables_invalid`. See [Actionable
                details](/en/errors/overview#actionable-details).
            request_id:
              type: string
              description: Request ID. Quote it when you contact support.
              example: req_01J8ZK9M3Q7XABCDEFGHJKMNPQ
          description: Error details.
      required:
        - error
    Message:
      type: object
      properties:
        id:
          type: string
          description: Message ID.
          example: msg_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        channel:
          type: string
          description: ID of the channel used.
          example: chan_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        direction:
          type: string
          enum:
            - outbound
            - inbound
          description: >-
            Message direction: `outbound` (left the channel's number, through
            the API or the WhatsApp Business app) or `inbound` (received).
        origin:
          type: string
          enum:
            - api
            - business_app
          nullable: true
          description: >-
            Where an `outbound` message came from: `api` (sent through Routa) or
            `business_app` (the business sent it from the WhatsApp Business app,
            on a number connected in coexistence mode). A `business_app` message
            is not billed and does not count as usage. It is `null` on an
            `inbound` message.
          example: api
        from:
          type: string
          description: Sender address, in E.164.
          example: '+5581988888888'
        to:
          type: string
          description: >-
            Recipient address, in E.164. On a `business_app` message, it can be
            a provider identifier when the recipient's number is unknown.
          example: '+5581999999999'
        content:
          oneOf:
            - type: object
              required:
                - type
                - body
              properties:
                type:
                  type: string
                  enum:
                    - text
                  description: Always `text` on a text message.
                body:
                  type: string
                  description: Body of the text.
            - type: object
              required:
                - type
                - media_id
              properties:
                type:
                  type: string
                  enum:
                    - image
                  description: Always `image` on an image.
                media_id:
                  type: string
                  description: >-
                    ID (`med_...`) of the file stored by Routa. Call `GET
                    /v1/media/{id}` to get a signed URL.
                caption:
                  type: string
                  description: Caption. Absent when there is none.
            - type: object
              required:
                - type
                - media_id
              properties:
                type:
                  type: string
                  enum:
                    - document
                  description: Always `document` on a document.
                media_id:
                  type: string
                  description: >-
                    ID (`med_...`) of the file stored by Routa. Call `GET
                    /v1/media/{id}` to get a signed URL.
                filename:
                  type: string
                  description: File name. Absent when there is none.
                caption:
                  type: string
                  description: Caption. Absent when there is none.
            - type: object
              required:
                - type
                - media_id
              properties:
                type:
                  type: string
                  enum:
                    - audio
                  description: Always `audio` on an audio message.
                media_id:
                  type: string
                  description: >-
                    ID (`med_...`) of the file stored by Routa. Call `GET
                    /v1/media/{id}` to get a signed URL.
            - type: object
              required:
                - type
                - media_id
              properties:
                type:
                  type: string
                  enum:
                    - video
                  description: Always `video` on a video.
                media_id:
                  type: string
                  description: >-
                    ID (`med_...`) of the file stored by Routa. Call `GET
                    /v1/media/{id}` to get a signed URL.
                caption:
                  type: string
                  description: Caption. Absent when there is none.
            - type: object
              required:
                - type
                - media_id
              properties:
                type:
                  type: string
                  enum:
                    - sticker
                  description: Always `sticker` on a sticker.
                media_id:
                  type: string
                  description: >-
                    ID (`med_...`) of the file stored by Routa. Call `GET
                    /v1/media/{id}` to get a signed URL.
            - type: object
              required:
                - type
                - latitude
                - longitude
              properties:
                type:
                  type: string
                  enum:
                    - location
                  description: Always `location` on a location.
                latitude:
                  type: number
                  description: Latitude of the place.
                longitude:
                  type: number
                  description: Longitude of the place.
                name:
                  type: string
                  description: Name of the place. Absent when there is none.
                address:
                  type: string
                  description: Address of the place. Absent when there is none.
            - type: object
              required:
                - type
                - target_message_id
                - emoji
              properties:
                type:
                  type: string
                  enum:
                    - reaction
                  description: Always `reaction` on a reaction.
                target_message_id:
                  type: string
                  description: ID (`msg_...`) of the message that was reacted to.
                emoji:
                  type: string
                  description: >-
                    The reaction emoji. An empty string means an earlier
                    reaction was removed.
            - type: object
              required:
                - type
                - template_id
                - body_parameters
              properties:
                type:
                  type: string
                  enum:
                    - template
                  description: Always `template` on a template send.
                template_id:
                  type: string
                  description: ID (`tmpl_...`) of the template sent.
                body_parameters:
                  type: array
                  items:
                    type: string
                  description: The values of the `{{n}}` variables of the body, in order.
                header_parameter:
                  oneOf:
                    - type: object
                      required:
                        - text
                      properties:
                        text:
                          type: string
                          description: The value of the variable in the text header.
                    - type: object
                      required:
                        - media_id
                      properties:
                        media_id:
                          type: string
                          description: ID (`med_...`) of the file sent in the media header.
                        filename:
                          type: string
                          description: >-
                            File name of a document header. Absent when none was
                            given.
                  description: >-
                    What was sent to the template header: `text`, the value of
                    its variable, or `media_id` (with `filename`, on a
                    document). Absent when the header asks for nothing.
                button_parameters:
                  type: array
                  items:
                    type: object
                    required:
                      - index
                      - text
                    properties:
                      index:
                        type: integer
                        description: >-
                          The position of the button in `components.buttons`,
                          starting at 0.
                      text:
                        type: string
                        description: The value that replaced `{{1}}` in the button URL.
                  description: >-
                    The values sent to the URL buttons with a variable, as
                    received. `index` is the position of the button in
                    `components.buttons`, starting at 0. Absent when the
                    template asks for none.
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - unsupported
                  description: >-
                    Always `unsupported`: received content that Routa does not
                    represent yet.
          nullable: true
          description: >-
            Message content. The `type` field gives the format. It is `null`
            once retention removes the content; `content_redacted_at` then gives
            the time of the removal.
        content_redacted_at:
          format: date-time
          type: string
          nullable: true
          description: >-
            When retention removed the message content. `null` while the message
            still has it.
          example: null
        status:
          type: string
          enum:
            - accepted
            - sent
            - delivered
            - read
            - failed
          description: Current state in the lifecycle. The status never goes back.
        failure_code:
          type: string
          nullable: true
          description: >-
            Reason for the failure, from a closed set of Routa codes, never a
            provider code. `null` until the message fails.
          example: null
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Up to 20 text key-value pairs that you own.
        accepted_at:
          format: date-time
          type: string
          description: When Routa accepted the message.
          example: '2026-09-04T13:22:41.031Z'
        sent_at:
          format: date-time
          type: string
          nullable: true
          description: >-
            When the provider accepted the message. `null` if it has not
            happened yet.
          example: '2026-09-04T13:22:41.031Z'
        delivered_at:
          format: date-time
          type: string
          nullable: true
          description: When delivery was confirmed. `null` if it has not happened yet.
          example: '2026-09-04T13:22:41.031Z'
        read_at:
          format: date-time
          type: string
          nullable: true
          description: When the recipient read it. `null` if it has not happened yet.
          example: null
        failed_at:
          format: date-time
          type: string
          nullable: true
          description: When the message failed. `null` if it did not fail.
          example: null
      required:
        - id
        - channel
        - direction
        - origin
        - from
        - to
        - content
        - content_redacted_at
        - status
        - failure_code
        - metadata
        - accepted_at
        - sent_at
        - delivered_at
        - read_at
        - failed_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Project API key, in the format `rt_live_...` or `rt_test_...`, sent as
        `Authorization: Bearer <key>`.

````

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