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

# Send a message.

> Name the sender with `from`, or let a campaign choose one of its numbers
with `campaign_id`. A scheduled message (`send_at`) needs `campaign_id`.
The price is held from the balance at acceptance.

Required permission: `messages:send`. Accepted credentials: a signed-in person, an API key, the account token.




## OpenAPI

````yaml /api-reference/openapi.yaml post /messages
openapi: 3.1.0
info:
  title: Sendblue Omni API
  version: '2026-11-23'
  summary: The native Sendblue communications API served by Omni.
  description: |
    The Sendblue Omni API: messages, numbers, calls, recordings, media, 10DLC
    registration, billing and webhooks for US messaging and calling.

    Every operation on this page is live. Requests and responses are JSON with
    `snake_case` names, at the root of the host with no version prefix. See the
    guides for [authentication](/authentication), [idempotency](/idempotency),
    [errors](/errors), [pagination](/pagination) and [webhooks](/webhooks).
  contact:
    name: Sendblue
    url: https://sendblue.com
servers:
  - url: https://omni-api.sendblue.com
    description: Production
security:
  - person: []
  - bearer: []
  - legacyKeyId: []
    legacyKeySecret: []
tags:
  - name: account
  - name: messages
  - name: numbers
  - name: brands
  - name: campaigns
  - name: calls
  - name: recordings
  - name: media
  - name: contacts
  - name: tags
  - name: variables
  - name: workflows
  - name: admin
  - name: operations
paths:
  /messages:
    post:
      tags:
        - messages
      summary: Send a message.
      description: >
        Name the sender with `from`, or let a campaign choose one of its numbers

        with `campaign_id`. A scheduled message (`send_at`) needs `campaign_id`.

        The price is held from the balance at acceptance.


        Required permission: `messages:send`. Accepted credentials: a signed-in
        person, an API key, the account token.
      operationId: createMessage
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageCreate'
            example:
              to: '+14155550101'
              from: '+14155550100'
              body: Your code is 482913
              status_callback: https://example.com/hooks/message
      responses:
        '201':
          description: The message was accepted.
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: |
        A value unique to this intended write, 1 to 128 visible ASCII
        characters. A repeat with the same key returns the original result.
      schema:
        type: string
        minLength: 1
        maxLength: 128
        pattern: ^[\x21-\x7E]+$
  schemas:
    MessageCreate:
      type: object
      required:
        - to
      additionalProperties: false
      properties:
        to:
          $ref: '#/components/schemas/PhoneNumber'
        from:
          $ref: '#/components/schemas/PhoneNumber'
          description: A number the account owns. Required unless `campaign_id` is given.
        campaign_id:
          type: string
          description: >-
            Send from this campaign's numbers. With `from`, that number must
            belong to it.
        body:
          type: string
          maxLength: 1600
          description: Required unless attachments are given.
        media_urls:
          type: array
          maxItems: 10
          items:
            type: string
            format: uri
          description: Public https URLs of attachments. Sends the message as MMS.
        media_ids:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: string
          description: >-
            Uploads owned by this account, in delivery order. Use these or
            media_urls. A qualified strict iMessage sender accepts one upload.
            An upload must remain readable when the transport retrieves it.
        status_callback:
          type: string
          format: uri
          description: A public https URL that receives the message's status changes.
        send_at:
          type: string
          format: date-time
          description: >-
            Send later, between 15 minutes and 35 days from now. Needs
            `campaign_id`.
        validity_period_seconds:
          type: integer
          minimum: 1
          maximum: 36000
          description: >-
            Fail the message if it has not been handed to the carrier in this
            time.
        max_price_micro_usd:
          type: integer
          format: int64
          minimum: 1
          description: Refuse the message if it would cost more than this.
    Message:
      type: object
      required:
        - id
        - direction
        - status
        - to
        - from
        - campaign_id
        - body
        - media_urls
        - segments
        - price
        - error_code
        - status_callback
        - created_at
        - updated_at
        - sent_at
      additionalProperties: false
      properties:
        delivery_evidence:
          type: string
          enum:
            - verified
            - unknown
            - reported
            - reported_unconfirmed
          description: >-
            Evidence that an iMessage line sent the message. `verified` is the
            strongest evidence, read from the sending device's own record.
            `reported` means the device's authenticated report was corroborated
            by a second check. `reported_unconfirmed` means the report lacks
            that corroboration. The message status separately records recipient
            delivery.
        billing_status:
          type: string
          enum:
            - held
            - charged
            - uncharged
            - review
          description: >-
            The reservation is held, captured, released without charge, or
            awaiting review by Sendblue after a late affirmative report.
        id:
          type: string
        direction:
          $ref: '#/components/schemas/MessageDirection'
        usage:
          $ref: '#/components/schemas/MessageUsage'
        status:
          $ref: '#/components/schemas/MessageStatus'
        to:
          $ref: '#/components/schemas/PhoneNumber'
        from:
          description: The sender. Null until a campaign has chosen one.
          oneOf:
            - $ref: '#/components/schemas/PhoneNumber'
            - type: 'null'
        campaign_id:
          type:
            - string
            - 'null'
          description: The campaign the message was sent through, if one was named.
        body:
          type: string
          description: Empty after redaction.
        media_urls:
          type: array
          description: >-
            Ordered attachment URLs. Outbound messages retain the submitted
            URLs. Inbound messages link to Omni Media resources that require the
            owning account's credentials.
          items:
            type: string
            format: uri
        segments:
          type:
            - integer
            - 'null'
          description: SMS segments, once known.
        price:
          description: What the message cost, once settled.
          oneOf:
            - $ref: '#/components/schemas/Money'
            - type: 'null'
        error_code:
          type:
            - integer
            - 'null'
          description: The failure class of a `failed` or `undelivered` message.
        status_callback:
          type:
            - string
            - 'null'
          format: uri
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
        sent_at:
          $ref: '#/components/schemas/NullableTimestamp'
    PhoneNumber:
      type: string
      description: A phone number in E.164 form.
      pattern: ^\+[1-9][0-9]{6,14}$
      example: '+14155550100'
    MessageDirection:
      type: string
      description: '`outbound_reply` is a message a TwiML reply to an inbound message sent.'
      enum:
        - inbound
        - outbound_api
        - outbound_reply
    MessageUsage:
      type: object
      description: >-
        A composed SMS or MMS reservation or settlement. Amounts become
        available when the corresponding financial decision is posted. An
        explicit zero is a confirmed amount.
      additionalProperties: false
      required:
        - message_id
        - direction
        - service
        - outcome
        - reason
        - carrier_status
        - estimated_parts
        - billed_parts
        - maximum_hold
        - base_charge
        - surcharge_charged
        - total_charge
        - uncollected
      properties:
        message_id:
          type:
            - string
            - 'null'
          description: Message ID when the item is a message of this API.
        inbox_message_id:
          type: string
          description: Inbox message ID of a shared inbound item.
        direction:
          type: string
          enum:
            - outbound
            - inbound
        service:
          type: string
          enum:
            - SMS
            - MMS
        outcome:
          type: string
          description: State of the reserve or settlement.
        reason:
          type:
            - string
            - 'null'
          description: Why the amount was captured
          capped: null
          held for review or released.: null
        carrier_status:
          type:
            - string
            - 'null'
          description: >-
            Native delivery status observed when the pricing decision was
            recorded.
        estimated_parts:
          type:
            - integer
            - 'null'
        billed_parts:
          type:
            - integer
            - 'null'
        maximum_hold:
          $ref: '#/components/schemas/NullableUsagePrice'
        base_charge:
          $ref: '#/components/schemas/NullableUsagePrice'
        surcharge_charged:
          $ref: '#/components/schemas/NullableUsagePrice'
        total_charge:
          $ref: '#/components/schemas/NullableUsagePrice'
        uncollected:
          $ref: '#/components/schemas/NullableUsagePrice'
    MessageStatus:
      type: string
      enum:
        - scheduled
        - queued
        - sending
        - sent
        - delivered
        - undelivered
        - failed
        - canceled
        - received
        - unknown
    Money:
      type: object
      required:
        - amount_micro_usd
        - currency
      additionalProperties: false
      properties:
        amount_micro_usd:
          type: integer
          format: int64
          description: Millionths of a US dollar. 1 USD is 1000000.
        currency:
          type: string
          const: USD
      example:
        amount_micro_usd: 7900
        currency: USD
    Timestamp:
      type: string
      format: date-time
      description: RFC 3339, UTC.
    NullableTimestamp:
      type:
        - string
        - 'null'
      format: date-time
    Error:
      type: object
      required:
        - error
      additionalProperties: false
      properties:
        error:
          type: object
          required:
            - code
            - message
          additionalProperties: false
          properties:
            code:
              $ref: '#/components/schemas/ErrorCode'
            message:
              type: string
            details:
              type: object
              description: >
                Machine-readable context. `field` names the request member,

                parameter or header at fault; `reason` narrows `unprocessable`,

                and `forbidden` for a verified person with no seat (`no_seat`),

                whose active membership could not be confirmed
                (`membership_unclassified`), or

                whose company has no usable account (`account_required`,
                `account_suspended`).
              properties:
                field:
                  type: string
                reason:
                  type: string
                recovery:
                  type: string
                  enum:
                    - retry_same_idempotency_key
                    - read_resource
                    - reconcile_tag_membership
                  description: >-
                    Required for write_outcome_unknown. Follow the
                    operation-specific recovery before attempting another write.
                required_permission:
                  $ref: '#/components/schemas/Permission'
              additionalProperties: true
    NullableUsagePrice:
      oneOf:
        - $ref: '#/components/schemas/Price'
        - type: 'null'
    ErrorCode:
      type: string
      description: >
        The catalogue of error codes, with the status each is sent with.


        | Code | Status | Meaning |

        | --- | --- | --- |

        | `invalid_request` | 400 | The request is malformed: bad JSON, an
        unknown or mistyped member, a bad parameter or header. |

        | `unauthenticated` | 401 | No credential, or one that does not verify.
        |

        | `insufficient_funds` | 402 | The balance cannot cover the price, or
        debt is outstanding. |

        | `forbidden` | 403 | The account, resource or deployment refuses this
        operation. |

        | `permission_denied` | 403 | The credential lacks the named permission.
        See `details.required_permission`. |

        | `not_found` | 404 | No such route, or no such resource in this
        account. |

        | `method_not_allowed` | 405 | The route exists and does not take this
        method. |

        | `conflict` | 409 | The resource is not in a state that allows the
        change. |

        | `idempotency_conflict` | 409 | The `Idempotency-Key` was used for a
        different request. |

        | `payload_too_large` | 413 | The request body is over the limit. |

        | `unsupported_media_type` | 415 | The body is not `application/json`. |

        | `unprocessable` | 422 | The request is well formed and cannot be
        carried out; `details.reason` says why. |

        | `unsupported` | 422 | The member or value is defined and not available
        yet. |

        | `rate_limited` | 429 | Too many requests; wait `Retry-After` seconds.
        |

        | `internal` | 500 | An unexpected failure. |

        | `unavailable` | 503 | A dependency is unavailable or the request ran
        out of time; retry. |

        | `upstream_unavailable` | 503 | The resource service is unavailable.
        Wait the number of seconds in Retry-After. |

        | `write_outcome_unknown` | 503 | The owner may have committed. Follow
        details.recovery. Retry-After is omitted. |
      enum:
        - invalid_request
        - unauthenticated
        - insufficient_funds
        - forbidden
        - permission_denied
        - not_found
        - method_not_allowed
        - conflict
        - idempotency_conflict
        - payload_too_large
        - unsupported_media_type
        - unprocessable
        - unsupported
        - rate_limited
        - internal
        - unavailable
        - upstream_unavailable
        - write_outcome_unknown
    Permission:
      type: string
      enum:
        - accounts:create
        - billing:history
        - billing:read
        - billing:refill
        - billing:top_up
        - brands:read
        - brands:write
        - calls:create
        - calls:read
        - calls:write
        - campaigns:read
        - campaigns:write
        - company_settings:read
        - contacts:read
        - contacts:write
        - keys:manage
        - me:read
        - media:read
        - media:write
        - messages:read
        - messages:send
        - messages:write
        - number_orders:cancel
        - number_orders:create
        - number_orders:read
        - numbers:purchase
        - numbers:read
        - numbers:release
        - numbers:write
        - operations:read
        - prices:read
        - recordings:read
        - recordings:write
        - settings:read
        - settings:write
        - subaccounts:manage
        - tags:read
        - tags:write
        - team:manage
        - team:read
        - variables:read
        - variables:write
        - webhooks:manage
        - webhooks:receive
        - workflows:read
        - workflows:write
    Price:
      type: object
      description: |
        An amount in US dollars. `amount` is a decimal string with two to six
        decimals; `amount_micro_usd` is the same amount as every other money
        member of this API states it.
      required:
        - amount
        - amount_micro_usd
        - currency
      additionalProperties: false
      properties:
        amount:
          type: string
          pattern: ^[0-9]+\.[0-9]{2,6}$
        amount_micro_usd:
          type: integer
          format: int64
          minimum: 0
        currency:
          type: string
          const: USD
      example:
        amount: '4.00'
        amount_micro_usd: 4000000
        currency: USD
  headers:
    RequestId:
      description: |
        `Request-Id`. Identifies this request in Sendblue's logs. Present on
        every response of this API, success or error, and readable by a page
        on an allowed origin.
      schema:
        type: string
        pattern: ^RQ[0-9a-f]{32}$
      example: RQ0123456789abcdef0123456789abcdef
    RetryAfter:
      description: >-
        Seconds to wait before repeating the request. Present on throttled
        requests and resource service outages.
      schema:
        type: integer
  responses:
    Error:
      description: >
        Any response that is not 2xx: `400 invalid_request`,

        `401 unauthenticated`, `402 insufficient_funds`, `403 forbidden` or
        `permission_denied`,

        `404 not_found`, `405 method_not_allowed`, `409 conflict` or

        `idempotency_conflict`, `413 payload_too_large`,

        `415 unsupported_media_type`, `422 unprocessable`, `429 rate_limited`,

        `500 internal`, `503 unavailable`, `upstream_unavailable` or
        `write_outcome_unknown`.
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: Unknown field
              details:
                field: colour
  securitySchemes:
    person:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A person's session: `Authorization: Bearer <ID token>`, the ID token the
        Sendblue sign-in issues. The person acts in their company's root account
        with the role of their seat.
    bearer:
      type: http
      scheme: bearer
      bearerFormat: <credential id>.<secret>
      description: >-
        `Authorization: Bearer <credential id>.<secret>`: an API key ID (`SK…`)
        with the key's secret, or an account ID (`AC…`) with the account's
        token. An existing Sendblue API key is accepted in the same form.
    legacyKeyId:
      type: apiKey
      in: header
      name: sb-api-key-id
      description: >-
        The ID of an existing Sendblue API key (or of an `SK…` key or `AC…`
        account), sent together with `sb-api-secret-key`.
    legacyKeySecret:
      type: apiKey
      in: header
      name: sb-api-secret-key
      description: The credential's secret, sent together with `sb-api-key-id`.

````

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