POSThttps://whatsapp-notification.montymobile.com/api/v2/WhatsappApi/send-otp

Send OTP via WhatsApp

Delivers a one-time password to a user's WhatsApp number using a pre-approved OTP template. The OTP value is injected dynamically into the template body at send time.

Request Body Parameters

ParameterTypeRequiredDescription
toStringYesRecipient phone number, international format. <Recipient_Phone_Number>
typeStringYesAlways "template".
sourceStringYesWhatsApp sender number. <Source_Number>
templateObjectYesContainer for all template-related fields.
template.nameStringYesExact name of the approved OTP template. <Template_Name>
template.languageObjectYesSpecifies the template language.
template.language.codeStringYesISO 639-1 language code. <Language_Code>
template.componentsArrayYesComponent objects — typically one "body" component containing the OTP value.
components[].typeStringYes"body", "header", or "button".
components[].parametersArrayYesFills the dynamic variables in the component.
parameters[].typeStringYes"text" for plain text values.
parameters[].textStringYesThe OTP code to inject. Example: "123456"

Example Request Body

json
{
  "to": "<Recipient_Phone_Number>",
  "type": "template",
  "source": "<Source_Number>",
  "template": {
    "name": "<Template_Name>",
    "language": { "code": "<Language_Code>" },
    "components": [
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "123456" }
        ]
      }
    ]
  }
}

cURL Example

bash
curl -X POST \
  "https://whatsapp-notification.montymobile.com/api/v2/WhatsappApi/send-otp" \
  -H "Tenant: <Tenant_ID>" \
  -H "api-key: <Your_API_Key>" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "<Recipient_Phone_Number>",
    "type": "template",
    "source": "<Source_Number>",
    "template": {
      "name": "<Template_Name>",
      "language": { "code": "<Language_Code>" },
      "components": [
        {
          "type": "body",
          "parameters": [
            { "type": "text", "text": "123456" }
          ]
        }
      ]
    }
  }'