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

# List messages (inbox + outbox) on a number

> Returns SMS messages on the number, inbound and outbound, scoped to the authenticated user. Newest first. Messages stay with the number across device switches.



## OpenAPI

````yaml /api-reference/mobilerun-numbers.yaml get /numbers/phones/{id}/messages
openapi: 3.1.0
info:
  title: Mobilerun Numbers
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /numbers/phones/{id}/messages:
    get:
      tags:
        - Numbers
      summary: List messages (inbox + outbox) on a number
      description: >-
        Returns SMS messages on the number, inbound and outbound, scoped to the
        authenticated user. Newest first. Messages stay with the number across
        device switches.
      operationId: listNumberMessages
      parameters:
        - schema:
            type: string
            format: uuid
            example: 550e8400-e29b-41d4-a716-446655440000
          required: true
          name: id
          in: path
        - schema:
            type: integer
            minimum: 1
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - all
              - inbound
              - outbound
            default: all
          required: false
          name: direction
          in: query
        - schema:
            type: string
            format: date-time
          required: false
          name: since
          in: query
      responses:
        '200':
          description: Messages retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PublicPhoneMessageListResponse'
                required:
                  - data
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
        '503':
          description: >-
            Service Unavailable — phone numbers are disabled for this deployment
            (see `reason`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NumberErrorResponse'
components:
  schemas:
    PublicPhoneMessageListResponse:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              esimId:
                type:
                  - string
                  - 'null'
                format: uuid
              direction:
                type: string
                enum:
                  - inbound
                  - outbound
              status:
                type: string
                enum:
                  - received
                  - queued
                  - claimed
                  - sending
                  - sent
                  - sent_unconfirmed
                  - delivered
                  - failed
              peerNumber:
                type:
                  - string
                  - 'null'
              peerKey:
                type:
                  - string
                  - 'null'
              body:
                type:
                  - string
                  - 'null'
              deliveryStatus:
                type:
                  - string
                  - 'null'
              detectedSender:
                type:
                  - string
                  - 'null'
              occurredAt:
                type: string
                format: date-time
              createdAt:
                type: string
                format: date-time
            required:
              - id
              - esimId
              - direction
              - status
              - peerNumber
              - peerKey
              - body
              - deliveryStatus
              - detectedSender
              - occurredAt
              - createdAt
        pagination:
          type: object
          properties:
            hasNext:
              type: boolean
            hasPrev:
              type: boolean
            page:
              type: integer
              minimum: 1
            pageSize:
              type: integer
              minimum: 1
            pages:
              type: integer
              minimum: 0
            total:
              type: integer
              minimum: 0
          required:
            - hasNext
            - hasPrev
            - page
            - pageSize
            - pages
            - total
      required:
        - items
        - pagination
    NumberErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        reason:
          type: string
          enum:
            - product_disabled
            - not_cancellable
        message:
          type: string
      required:
        - success
        - reason
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````