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
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | String | Yes | Recipient phone number, international format. <Recipient_Phone_Number> |
| type | String | Yes | Always "template". |
| source | String | Yes | WhatsApp sender number. <Source_Number> |
| template | Object | Yes | Container for all template-related fields. |
| template.name | String | Yes | Exact name of the approved OTP template. <Template_Name> |
| template.language | Object | Yes | Specifies the template language. |
| template.language.code | String | Yes | ISO 639-1 language code. <Language_Code> |
| template.components | Array | Yes | Component objects — typically one "body" component containing the OTP value. |
| components[].type | String | Yes | "body", "header", or "button". |
| components[].parameters | Array | Yes | Fills the dynamic variables in the component. |
| parameters[].type | String | Yes | "text" for plain text values. |
| parameters[].text | String | Yes | The 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" }
]
}
]
}
}'