Use this endpoint to send a one-time password (OTP) via WhatsApp using a pre-approved authentication template.
Before making requests, ensure you have configured authentication.
For the full technical reference, see the OpenAPI specification.
POST /api/services/send-otp| Name | Required | Description |
|---|---|---|
Authorization | Yes | Basic Auth credentials. See Authentication. |
X-Api-Key | Yes | API key for the account. See Authentication. |
Content-Type | Yes | Must be application/json. |
Authentication templates use WhatsApp's preset message text: <VERIFICATION_CODE> is your verification code.
The OTP code you provide replaces <VERIFICATION_CODE>. Parameters are limited to 15 characters.
See Authentication templates for details on components and button behavior.
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Destination phone number in E.164 format (e.g. +390000000000) |
language | string | Yes | Template language code (e.g. it, en). See supported languages. Falls back to the template's default language if not found. |
templateId | integer | Yes | The authentication template ID to use |
otp | string | Yes | The OTP code to send (max 15 characters, e.g. "123456") |
reference | object | No | Tracking information: service (optional), action (optional), key (optional) |
lra | string | No | Local Registration Authority (LRA) identifier |
businessRelationId | string | No | One Platform Business Relation ID. If specified, consumption is attributed to this BRI. |
{
"to": "+390000000000",
"language": "it",
"templateId": 1,
"otp": "123456",
"reference": {
"service": "DIGITALSIGN",
"action": "2FA",
"key": "ext-key-002"
}
}200 — Message sent
{
"messageId": "3425151601"
}The messageId uniquely identifies the sent message and can be used to track its delivery status.
| HTTP Status | Error code | Error type | Solution |
|---|---|---|---|
400 | 3 | ConstraintViolationException | Check the request parameters against the API documentation |
400 | 7 | InvalidTemplateException | The specified templateId does not exist or is not available for your account |
400 | 8 | WrongNumberException | Verify the to number is in valid E.164 format |
For authentication errors (code 1, 6, 9), see Authentication.
Each template has a default language defined in its configuration. If the language specified in the request does not exist for the given templateId, the API automatically falls back to the template's default language.