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

# Send a message

> Use this endpoint to send a message to one or more recipients (up to 10 recipients). If you want to use channels other than SMS (Viber, WhatsApp, etc.), you need to use the `flow` property.




## OpenAPI

````yaml /openapi/en/json/jsonapi_v2.yaml post /message
openapi: 3.1.0
info:
  title: JSON API
  description: >
    API for sending messages via SMS, Viber, WhatsApp and other communication
    channels.


    ## JSON API v2


    API key is required for all requests. You can find your API key in your
    [account settings](https://app.smsmanager.com/api-cloud).


    API versions (http-api and xml-api) are deprecated also and you should use
    this JSON API v2 instead.
  version: v2
  contact:
    url: https://smsmanager.cz
    email: cc@smsmanager.cz
servers:
  - url: https://api.smsmngr.com/v2
    description: Responds with your request data
security: []
tags:
  - name: sending
    x-displayName: Sending messages
    description: |
      For sending messages use one of the following endpoints.
      - `/message` for sending a message up to 10 recipients
      - `/messages` for sending multiple messages (up to 10 messages at once)
      - `/simple/message` for sending a simple message (GET and POST)
paths:
  /message:
    post:
      tags:
        - sending
      summary: Send a message
      description: >
        Use this endpoint to send a message to one or more recipients (up to 10
        recipients). If you want to use channels other than SMS (Viber,
        WhatsApp, etc.), you need to use the `flow` property.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Message'
            examples:
              Simple message:
                value:
                  body: Test message
                  to:
                    - phone_number: '420777123456'
              Message with flow:
                value:
                  body: Test message
                  to:
                    - phone_number: '420777123456'
                  flow:
                    - sms:
                        sender: SmsManager
                        gateway: high
                        ttl: 10
              Scheduled message:
                value:
                  body: Meeting reminder
                  to:
                    - phone_number: '420777123456'
                  datetime: '2025-01-11T10:00:00Z'
              Message with callback and payload:
                value:
                  body: Order shipped
                  to:
                    - phone_number: '420777123456'
                  callback: https://example.com/delivery
                  payload:
                    order_id: ORD-1001
              Unicode SMS with custom TTL:
                value:
                  body: 'Привет, Ваш код: 1234'
                  to:
                    - phone_number: '420777123456'
                  tag: transactional
                  flow:
                    - sms:
                        sender: SmsManager
                        type: utf
                        ttl: 5
      responses:
        '200':
          description: Messages sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  Message:
                    type: string
                    description: Error message.
                    example: >-
                      User is not authorized to access this resource with an
                      explicit deny
      security:
        - x-api-key: []
components:
  schemas:
    Message:
      type: object
      required:
        - body
        - to
      properties:
        body:
          type: string
          maxLength: 1000
          description: The message body (if not defined in the flow).
        to:
          type: array
          minItems: 1
          maxItems: 10
          description: List of recipients.
          items:
            type: object
            properties:
              phone_number:
                type: string
                description: >-
                  Recipient's phone number. The international format (E.164,
                  without leading `+` or `00`) is recommended but also another
                  format is accepted (before accepting the request, we will
                  convert it to the international format).
                example: '420777123456'
            required:
              - phone_number
        callback:
          type: string
          format: uri
          description: >-
            Callback URL for receiving delivery notifications (Webhook, see
            [Webhooks](#tag/Webhooks)).
        tag:
          type: string
          default: promotional
          description: >-
            Tag for the message. You can use it to group messages (e.g. by
            campaign id). There are also some special tags you can use:
            `priority` (for priority messages), `transactional` (for
            transactional messages).
        params:
          type: object
          description: >-
            By providing this object, you can pass special parameters to the
            message. Ask us how to use this parameter for shortening links or
            other features.
        datetime:
          type: string
          format: date-time
          description: Scheduled time for sending the message. Always in UTC timezone.
          example: '2025-01-11T10:00:00Z'
        delivery_time:
          type: object
          properties:
            days:
              type: array
              items:
                type: string
                enum:
                  - monday
                  - tuesday
                  - wednesday
                  - thursday
                  - friday
                  - saturday
                  - sunday
              description: Days of the week for the scheduled time.
            start:
              type: string
              description: Start time for the scheduled time.
              example: '08:00'
            end:
              type: string
              description: End time for the scheduled time.
              example: '21:00'
            tz:
              type: string
              description: Timezone for the scheduled time.
              example: Europe/Prague, Europe/London, Europe/Berlin, America/New_York
              default: UTC
        flow:
          type: array
          description: >-
            A list of communication channels for the message flow. If defined,
            must not be empty. You can use multiple channels, the order of
            channels is important (first channel is the first to be used, if the
            first channel is not available or recipient does not accept it, the
            second channel is used, etc.).
          items:
            type: object
            additionalProperties: false
            minProperties: 1
            maxProperties: 1
            properties:
              sms:
                type: object
                properties:
                  body:
                    type: string
                    maxLength: 1000
                    description: >-
                      This definition of message body here have higher priority
                      than the one defined in the root object.
                  sender:
                    type: string
                    description: >-
                      Alphanumeric sender name (max. 11 characters,
                      pre-registration may be required) or dedicated virtual
                      number (without `+`).
                    examples:
                      - Mojefirma
                      - 420777123456
                  gateway:
                    type: string
                    enum:
                      - high
                      - direct
                      - custom
                    default: high
                    description: >-
                      Use `direct` if you use dedicated virtual number. Use
                      `custom` if you use SIM hosting.
                  ttl:
                    type: integer
                    description: Time to live in minutes.
                  type:
                    type: string
                    enum:
                      - sms
                      - utf
                    default: utf
                    description: >-
                      Set `utf` if you want to keep unicode characters in the
                      message. Set `sms` if you want to convert or remove
                      unicode from message to keep maximal capacity in SMS.
                required:
                  - body
              viber:
                type: object
                properties:
                  body:
                    type: string
                    maxLength: 1000
                    description: >-
                      This definition of message body here have higher priority
                      than the one defined in the root object.
                  sender:
                    type: string
                    description: >-
                      Use the name of the sender you have pre-registered for
                      your Viber Business Message.
                  buttons:
                    type: array
                    maxItems: 1
                    items:
                      type: object
                      required:
                        - title
                        - url
                      properties:
                        title:
                          type: string
                        url:
                          type: string
                          format: uri
                  ttl:
                    type: integer
                    description: Time to live in minutes.
                required:
                  - body
                  - sender
              whatsapp_text:
                type: object
                properties:
                  body:
                    type: string
                    description: >-
                      This definition of message body here have higher priority
                      than the one defined in the root object. You can use
                      custom body of message only when the recipient already
                      reply to your template message or send you a message
                      first.
                    maxLength: 1000
                  sender:
                    type: string
                    description: >-
                      Phone Number ID of registered WhatsApp number. You can
                      find it in your [WhatsApp
                      settings](https://app.smsmanager.com/whatsapp).
                    examples:
                      - '514578330250514'
                required:
                  - body
                  - sender
              whatsapp_template:
                type: object
                properties:
                  template_name:
                    type: string
                    description: >-
                      The name of the template you have pre-registered and
                      approved before use.
                    maxLength: 100
                  sender:
                    type: string
                    description: >-
                      Phone Number ID of registered WhatsApp number. You can
                      find it in your [WhatsApp
                      settings](https://app.smsmanager.com/whatsapp).
                    examples:
                      - '514578330250514'
                  params:
                    type: array
                    items:
                      type: string
                    description: >-
                      If your template has parameters, you need to pass values
                      for them here.
                  params_header:
                    type: array
                    items:
                      type: string
                    description: >-
                      If your template has header with parameter, you need to
                      pass value for it here.
                  params_buttons:
                    type: array
                    items:
                      type: string
                    description: >-
                      If your template buttons have parameters, you need to pass
                      values for them here.
                  language:
                    type: string
                    examples:
                      - en
                      - cs
                    description: >-
                      The language of the template (you can have multiple
                      languages for the same template).
                  ttl:
                    type: integer
                    description: Time to live in minutes.
                required:
                  - template_name
                  - language
                  - sender
        payload:
          type: object
          description: >
            You can send the message payload, where you can define any
            parameters for the message. This object is returned in the delivery
            notification and replies.
          example:
            user_id: '123456'
    MessageResponse:
      type: object
      properties:
        request_id:
          type: string
          description: Unique request identifier.
        accepted:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: Index of the original recipient from the `to` array.
              message_id:
                type: string
                description: Unique message identifier for accepted message.
        rejected:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: Index of the original recipient from the `to` array.
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````