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

# List messages

> List all messages in an inbox, across every thread. Supports pagination for high-volume inboxes.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/inboxes/{id}/messages
openapi: 3.0.3
info:
  title: OpenMail API
  description: >-
    Email infrastructure API for AI agents. Create inboxes, send and receive
    email, and get real-time notifications via webhooks.
  version: 1.0.0
  license:
    name: Proprietary
servers:
  - url: https://api.openmail.sh
security:
  - bearerAuth: []
tags:
  - name: pods
    description: Isolated sub-accounts for your end users or tenants
  - name: inboxes
    description: Email inboxes and their webhook configuration
  - name: messages
    description: Sending and listing messages
  - name: threads
    description: Conversation threads and read status
  - name: attachments
    description: Downloading and extracting text from attachments
paths:
  /v1/inboxes/{id}/messages:
    get:
      tags:
        - messages
      summary: List messages
      description: >-
        List all messages in an inbox, across every thread. Supports pagination
        for high-volume inboxes.
      operationId: listMessages
      parameters:
        - schema:
            type: integer
            default: 50
          in: query
          name: limit
          required: false
        - schema:
            type: integer
            default: 0
          in: query
          name: offset
          required: false
        - schema:
            $ref: '#/components/schemas/MessageDirection'
          in: query
          name: direction
          required: false
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: List of messages
          content:
            application/json:
              schema:
                description: List of messages
                type: object
                additionalProperties: true
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Message'
                  total:
                    type: integer
        '401':
          description: Missing, invalid, or expired API key
          content:
            application/json:
              schema:
                description: Missing, invalid, or expired API key
                allOf:
                  - $ref: '#/components/schemas/Error'
        '404':
          description: Inbox not found
          content:
            application/json:
              schema:
                description: Inbox not found
                allOf:
                  - $ref: '#/components/schemas/Error'
components:
  schemas:
    MessageDirection:
      type: string
      enum:
        - inbound
        - outbound
    Message:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        threadId:
          type: string
        direction:
          $ref: '#/components/schemas/MessageDirection'
        fromAddr:
          type: string
        toAddr:
          type: string
          description: >-
            Your OpenMail inbox address for inbound messages. For outbound
            sends, the primary recipient.
        headerTo:
          type: string
          description: >-
            Inbound only. The address the sender wrote to (comma-separated if
            multiple). When deliveryRole is cc, reply to this address — not
            fromAddr.
          nullable: true
        deliveryRole:
          type: string
          enum:
            - to
            - cc
            - null
          description: >-
            Inbound only. to if your inbox was the main recipient; cc if you
            were copied on the email.
          nullable: true
        cc:
          type: array
          items:
            type: string
          description: Email addresses copied on the message.
        subject:
          type: string
        bodyText:
          type: string
        bodyHtml:
          type: string
        attachments:
          type: array
          items:
            type: object
            additionalProperties: true
            properties:
              filename:
                type: string
              contentType:
                type: string
              sizeBytes:
                type: integer
              url:
                type: string
                description: Signed URL for download
        status:
          type: string
          enum:
            - pending
            - sent
            - received
            - failed
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      additionalProperties: true
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````