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

# Send an SMS

> Counts segments, checks credits, applies the compliance rules for the message class, debits credits and
queues the message. Marketing SMS outside 08:00 to 20:00 SAST (or on Sundays and public holidays) is held
and sent at 08:00 on the next permitted day with status `scheduled`. Requires `sms:send`.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/sms
openapi: 3.1.0
info:
  title: Sendbaze API
  version: '1.0'
  description: >
    Transactional email and SMS for Africa. Send from your own domain through
    Amazon SES in Cape Town.

    Every send returns an id immediately; delivery is reported by webhook and in
    the dashboard logs.
  contact:
    name: Sendbaze support
    email: support@sendbaze.com
    url: https://www.sendbaze.com
servers:
  - url: https://api.sendbaze.com
security:
  - bearerAuth: []
tags:
  - name: Emails
  - name: Templates
  - name: Domains
  - name: Suppressions
  - name: Webhooks
  - name: SMS
  - name: Usage
paths:
  /v1/sms:
    post:
      tags:
        - SMS
      summary: Send an SMS
      description: >
        Counts segments, checks credits, applies the compliance rules for the
        message class, debits credits and

        queues the message. Marketing SMS outside 08:00 to 20:00 SAST (or on
        Sundays and public holidays) is held

        and sent at 08:00 on the next permitted day with status `scheduled`.
        Requires `sms:send`.
      operationId: sendSms
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendSmsRequest'
            example:
              to: '+27821234567'
              body: Your OTP is 482 913. It expires in 5 minutes.
              class: transactional
      responses:
        '200':
          description: Queued or scheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendSmsResponse'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '423':
          $ref: '#/components/responses/Locked'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Up to 255 characters. The same key and body return the same response for
        24 hours.
      schema:
        type: string
        maxLength: 255
  schemas:
    SendSmsRequest:
      type: object
      required:
        - to
        - body
        - class
      properties:
        to:
          type: string
          description: E.164.
          example: '+27821234567'
        body:
          type: string
          maxLength: 1600
        senderId:
          type: string
          description: A registered alphanumeric sender id.
        class:
          $ref: '#/components/schemas/MessageClass'
        scheduledAt:
          type: string
          format: date-time
          description: Up to 30 days ahead.
        tags:
          type: array
          maxItems: 10
          items:
            type: string
            maxLength: 64
    SendSmsResponse:
      type: object
      required:
        - id
        - status
        - mode
        - segments
        - credits
      properties:
        id:
          type: string
          example: sm_01j9x7k2r4m8q3v5n6b7c8d9e0
        status:
          type: string
          enum:
            - queued
            - scheduled
        mode:
          type: string
          enum:
            - live
            - test
        segments:
          type: integer
          example: 1
        credits:
          type: integer
          example: 1
    MessageClass:
      type: string
      enum:
        - transactional
        - marketing
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
    ErrorBody:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable error code; see the errors reference.
          example: validation_error
        message:
          type: string
        docs:
          type: string
          format: uri
        fields:
          type: object
          description: Present on validation errors. Dotted path to messages.
          additionalProperties:
            type: array
            items:
              type: string
        limit:
          type: integer
          description: On `plan_limit`, the ceiling that was reached.
        upgradeUrl:
          type: string
          format: uri
          description: >-
            Where to change plan, when a bigger plan would have allowed the
            request.
        topUpUrl:
          type: string
          format: uri
          description: >-
            Where to add wallet funds, when a balance would have allowed the
            request.
        settingsUrl:
          type: string
          format: uri
          description: >-
            Where to change an organisation setting that blocked the request
            (SMS destinations).
        domainsUrl:
          type: string
          format: uri
          description: >-
            Where to add and verify a sending domain, on
            `sandbox_recipient_not_allowed` and `sandbox_limit_reached`.
  responses:
    PaymentRequired:
      description: Allowance used up, not enough credits, or plan limit reached
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unprocessable:
      description: >-
        Validation failed, a recipient is suppressed, or an SMS destination is
        not supported (destination_not_supported)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: validation_error
              message: The request has invalid fields.
              docs: https://docs.sendbaze.com/errors#validation_error
              fields:
                to.1:
                  - must be a valid email address
    Locked:
      description: Sending is paused for this organisation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key from the dashboard. `sk_live_…` sends; `sk_test_…` validates
        and returns ids without sending.

````

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