Request

POST https://auth.otpless.app/notification/v3/batch/send

Headers

  • clientId: Your client ID provided by OTPless.
  • clientSecret: Your client secret provided by OTPless.
  • Content-Type: application/json

Body

  • channel (String, required): The notification channel. For SMS, use "SMS".
  • senderId (String, conditional): The sender ID for the template (not required in case of countries like brazil).
  • templateId (String, conditional): The OTPless provided template ID. Required if dltTemplateId and dltTemplateText are not provided.
  • dltTemplateId (String, conditional): Template ID registered with DLT. Required if templateId is not provided.
  • orderId (String, optional): An order ID for tracking purposes. Will be returned in the response.
  • dltTemplateText (String, conditional): The template text. Use placeholders for variables as {#var#}. Required if templateId is not provided.
  • recipients (Array of Objects, required): An array of recipient objects.
    • sendTo (String, required): The phone number of the recipient.
    • countryCode (String, optional): Country code of the phone number. Please note if mobile number already contains country code in sendTo param then there is no need to provide country code param.
    • bodyParams (Array of Strings, required): An array of strings to replace placeholders in the template for templateId or dltTemplateText provided.
    • metadata (JsonObject, optional): A JSON object for any additional metadata. Will be attached to the delivery status webhook notification data.

You can use either templateId or both dltTemplateId and dltTemplateText in a request, but not all three.

The metadata field is optional and can be used to send any additional data.

Max recipients allowed is 1500.

Example Request

curl --location 'https://auth.otpless.app/notification/v3/batch/send' \
--header 'clientId: YOUR_CLIENT_ID' \
--header 'clientSecret: YOUR_CLIENT_SECRET' \
--header 'Content-Type: application/json' \
--data '{
    "channel": "SMS",
    "templateId": "YOUR_TEMPLATE_ID",
    "recipients": [
        {
            "sendTo": "USER_PHONE_NUMBER",
            "countryCode": "COUNTRY_CODE",
            "bodyParams": [
                "6723663",
                "bob"
            ],
            "metadata": {}
        }
    ]
}'

Example Response

{
  "orderId": "edk32023ke02303ie023ie3223e",
  "status": "CREATED"
}

For more details on handling delivery status and notifications, refer to our Webhook Guide.