/auth/verify.messages:send| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
phone | string | Yes | min:10, max:20, regex: digits/+/-/spaces/() | Recipient phone number with country code |
template_name | string | Yes | Must exist as APPROVED AUTHENTICATION template | Name of the authentication template |
code | string | Yes | The OTP/verification code to send | |
language | string | No | max:10 | Template language code (default: en) |
expiry_minutes | integer | No | min:1, max:60 | Code expiry time in minutes (default: 10) |
contact_id | integer | No | Must exist in contacts table | Existing contact ID (skips auto-creation) |
purpose | string | No | OTP purpose identifier (default: authentication) | |
additional_params | array | No | Additional template body parameters beyond code and expiry |
{{1}}) receives the OTP code{{2}}), if present, receives the expiry minutesotp{{1}} will automatically receive the OTP codecontact_id is provided and the phone number doesn't match an existing contact:FEATURE_LIMIT_EXCEEDED if exceeded)| Field | Type | Description |
|---|---|---|
message_id | string | WhatsApp message ID |
contact_id | integer | Contact ID (existing or auto-created) |
phone | string | Cleaned phone number |
template_name | string | Template name used |
language | string | Template language |
code_sent | boolean | Always true on success |
expiry_minutes | integer | Code expiry time in minutes |
expires_at | string | ISO 8601 expiry timestamp |
status | string | Message status (sent) |
sent_at | string | ISO 8601 send timestamp |
| Status | Error Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing API token |
| 403 | INSUFFICIENT_SCOPE | Token missing messages:send scope |
| 403 | FEATURE_LIMIT_EXCEEDED | Contact limit reached (auto-creation) |
| 403 | CONTACT_OPTED_OUT | Contact has opted out of messages |
| 403 | FEATURE_NOT_AVAILABLE | WhatsApp templates not available in plan |
| 403 | FEATURE_LIMIT_EXCEEDED | Conversation limit reached |
| 404 | RESOURCE_NOT_FOUND | Template not found or not approved |
| 404 | NOT_FOUND | Contact not found (when contact_id provided) |
| 422 | VALIDATION_ERROR | Request validation failed or template is not AUTHENTICATION category |
| 422 | WHATSAPP_NOT_CONFIGURED | WhatsApp not configured for this account |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests |
| 500 | MESSAGE_SEND_FAILED | Failed to send WhatsApp message |
| 500 | INTERNAL_ERROR | Unexpected server error |
| Field | Message |
|---|---|
phone | Phone number is required / Phone number must be at least 10 digits / Phone number can only contain digits, +, -, spaces, and parentheses |
template_name | Template name is required |
code | Authentication code is required |
curl --location --request POST '/auth/send-otp' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"phone": "+919999999999",
"template_name": "otp_verification",
"language": "en",
"code": "123456",
"expiry_minutes": 10,
"purpose": "authentication"
}'{}