Send SMS message asynchronously to a mobile number

<Note>If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number.</Note> <Note title="For end users in France">Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.</Note>

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Request

Values to send a transactional SMS
recipientstringRequired
Mobile number to send SMS with the country code
senderstringRequired<=15 characters

Name of the sender. The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters

organisationPrefixstringOptional

A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.

tagobjectOptional
Tag of the message
typeenumOptionalDefaults to transactional

Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc.

Allowed values:
unicodeEnabledbooleanOptionalDefaults to false
Format of the message. It indicates whether the content should be treated as unicode or not.
webUrlstringOptionalformat: "url"

Webhook to call for each event triggered by the message (delivered etc.)

templateIdintegerOptional
Template ID to send SMS with the template. When provided, overrides the content parameter. Mandatory if 'content' is not passed.
contentstringOptional

Content of the message. If more than 160 characters long, will be sent as multiple text messages. Mandatory if ‘templateId’ is not passed, ignored if ‘templateId’ is passed.

Response

SMS has been sent successfully to the recipient
messageIdlong

Errors