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

# Send SMS

> Send an SMS message



## OpenAPI

````yaml POST /sms/send
openapi: 3.0.1
info:
  title: OpenAPI Simpu API
  description: Simpu API Documentation
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.simpu.co
security:
  - apiKeyAuth: []
paths:
  /sms/send:
    post:
      description: Send an SMS message
      requestBody:
        description: SMS message object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendSMSRequest'
        required: true
      responses:
        '200':
          description: SMS response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SMS'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SendSMSRequest:
      type: object
      properties:
        channel:
          description: Channel to send the SMS message
          type: string
          enum:
            - sms
            - whatsapp
          example: sms
        recipients:
          description: Recipients of the SMS message, comma separated list of phone numbers
          type: string
          example: 2348023456789, 2348098765432
        sender_id:
          description: Sender ID of the SMS message
          type: string
          example: Simpu
          maxLength: 11
        content:
          description: >-
            Content of the SMS message, this is required if a template ID is not
            specified
          type: string
          example: Hello! World. This is a test message.
        template_id:
          description: >-
            Template ID of the SMS message, this is required if content is not
            specified
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        personalisation:
          description: >-
            Personalisation of the SMS message, this is applicable if a template
            ID is specified
          type: array
          items:
            $ref: '#/components/schemas/Personalisation'
        external_ref:
          description: This is a reference to the message in your system
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        is_trackable:
          description: >-
            This determines if links in the message should be tracked, links in
            the message will be replaced with trackable links
          type: boolean
          default: false
          example: false
        callback:
          description: 'This is the URL to receive delivery reports for the message `test` '
          type: string
          example: https://example.com/sms/delivery_report
      required:
        - recipients
        - sender_id
    SMS:
      required:
        - id
        - recipients
        - is_trackable
        - sender_id
      type: object
      properties:
        id:
          description: Unique ID of the SMS message
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        recipients:
          description: Recipients of the SMS message
          type: array
          example:
            - '2348023456789'
        sender_id:
          description: Sender ID of the SMS message
          type: string
          example: Simpu
          maxLength: 11
        is_trackable:
          description: This determines if links in the message should be tracked
          type: boolean
          example: false
        content:
          description: Content of the SMS message
          type: string
          example: Hello! World. This is a test message.
        external_ref:
          description: This is a reference to the message in your system
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        callback:
          description: This is the URL to receive delivery reports for the message
          type: string
          example: https://example.com/sms/delivery_report
        template_id:
          description: Template ID of the SMS message
          type: string
          example: 674535b2b39158b9aae90188fcec23eb
        personalisation:
          description: Personalisation of the SMS message
          type: array
          items:
            $ref: '#/components/schemas/Personalisation'
        created_datetime:
          description: Date and time the SMS was created
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
        updated_datetime:
          description: Date and time the SMS token was last updated, if any
          type: string
          example: '2024-06-28T23:56:38.128604+00:00'
        meta:
          $ref: '#/components/schemas/MetaSMS'
    Error:
      required:
        - status
        - message
      type: object
      properties:
        status:
          type: integer
          format: int32
          example: 200
        message:
          type: string
          example: Invalid request
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: name
              message:
                type: string
                example: 'Error in field: ''name'' Field required.'
              type:
                type: string
                example: missing
    Personalisation:
      required:
        - to
        - substitutions
      type: object
      properties:
        to:
          description: Recipient of the personalisation
          type: string
          example: '2348023456789'
        substitutions:
          description: Substitutions of the personalisation
          type: object
          example:
            name: John Doe
    MetaSMS:
      required:
        - method
        - resource
      type: object
      properties:
        method:
          description: The HTTP method used to make the request
          type: string
          example: POST
        resource:
          description: The resource requested
          type: string
          example: /send/sms
        estimate:
          $ref: '#/components/schemas/EstimateSMS'
    EstimateSMS:
      required:
        - available_balance
        - charge
        - encoding
        - message_length
        - pages
      type: object
      properties:
        available_balance:
          description: Available balance for the request
          type: number
          example: 1000.5
        charge:
          description: Charge for the request
          type: number
          example: 3
        encoding:
          description: Encoding of the message
          type: string
          enum:
            - GSM
            - UCS-2
          example: UTF-8
        message_length:
          description: Length of the message
          type: number
          example: 160
        pages:
          description: Number of pages for the message
          type: number
          example: 1
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: An API key to authenticate requests

````