> ## 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.

# Send an SMS through one eSIM



## OpenAPI

````yaml /api-reference/mobilerun-numbers.yaml post /numbers/esims/{id}/messages
openapi: 3.1.0
info:
  title: Mobilerun Numbers
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /numbers/esims/{id}/messages:
    post:
      tags:
        - Messages
      summary: Send an SMS through one eSIM
      operationId: sendEsimMessage
      parameters:
        - in: path
          name: id
          required: true
          schema:
            example: 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendEsimMessageInput'
      responses:
        '202':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/PublicMessageRow'
                required:
                  - data
                type: object
          description: Outbound message queued
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
          description: Conflict
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageErrorResponse'
          description: Too many requests
        '500':
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EsimErrorResponse'
          description: >-
            Service Unavailable — esims are disabled for this deployment (see
            `reason`)
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.esims.messages.send('550e8400-e29b-41d4-a716-446655440000', {
              body: 'x',
              to: '+15551230001',
            });


            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.esims.messages.send(
                id="550e8400-e29b-41d4-a716-446655440000",
                body="x",
                to="+15551230001",
            )
            print(response.data)
components:
  schemas:
    SendEsimMessageInput:
      additionalProperties: false
      properties:
        body:
          description: >-
            SMS body text (max 320 chars — smaller than the admin tier's cap;
            see the schema's own doc comment for why)
          maxLength: 320
          minLength: 1
          type: string
        clientRequestId:
          description: >-
            Client-supplied idempotency key, scoped to (owner, esimId, key).
            Replaying the same key + identical payload returns the original
            send; the same key with a DIFFERENT payload is a 409 conflict.
          maxLength: 128
          minLength: 1
          type: string
        deliveryReport:
          default: false
          description: >-
            Wait for physedge to confirm carrier delivery before completing the
            send (adds executor-side latency, never on this request — sends are
            always async/202). Defaults to false for the public tier (opt-in,
            unlike the admin tier's default-true).
          type: boolean
        to:
          description: >-
            Recipient phone number — normalized to E.164 (spaces/dashes/dots
            stripped); rejected with 400 if it doesn't validate as E.164
            afterward.
          example: '+15551230001'
          minLength: 1
          type: string
      required:
        - to
        - body
      type: object
    PublicMessageRow:
      properties:
        body:
          type:
            - string
            - 'null'
        createdAt:
          format: date-time
          type: string
        deliveryStatus:
          type:
            - string
            - 'null'
        detectedSender:
          type:
            - string
            - 'null'
        direction:
          enum:
            - inbound
            - outbound
          type: string
        esimId:
          format: uuid
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        occurredAt:
          format: date-time
          type: string
        peerKey:
          type:
            - string
            - 'null'
        peerNumber:
          type:
            - string
            - 'null'
        providerCode:
          type:
            - string
            - 'null'
        status:
          enum:
            - received
            - queued
            - claimed
            - sending
            - sent
            - sent_unconfirmed
            - delivered
            - failed
          type: string
      required:
        - id
        - esimId
        - direction
        - status
        - peerNumber
        - peerKey
        - body
        - deliveryStatus
        - detectedSender
        - providerCode
        - occurredAt
        - createdAt
      type: object
    MessageErrorResponse:
      properties:
        message:
          type: string
        reason:
          enum:
            - not_installed
            - missing_device
            - missing_subscription
            - idempotency_conflict
            - send_disabled
            - daily_cap_exceeded
            - rate_limited
            - product_disabled
          type: string
        success:
          enum:
            - false
          type: boolean
      required:
        - success
        - reason
        - message
      type: object
    EsimErrorResponse:
      properties:
        message:
          type: string
        reason:
          enum:
            - out_of_stock
            - owner_esim_cap
            - byo_disabled
            - byo_esim_cap
            - byo_daily_import_limit
            - byo_failed_limit
            - esim_not_owned
            - device_pool_empty
            - device_claim_cap
            - operator_resolution_required
            - idempotency_conflict
            - byo_awaiting_payment_cap
            - operator_review_required
            - byo_not_reassignable
            - product_disabled
          type: string
        success:
          enum:
            - false
          type: boolean
      required:
        - success
        - reason
        - message
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````