# Send a WhatsApp OTP message

Sends a one-time password (OTP) via WhatsApp using a pre-approved authentication template. See Send an OTP message for details.

Endpoint: POST /api/services/send-otp
Version: 2.1.0.0
Security: basicAuth, ApiKeyAuth

## Request fields (application/json):

  - `to` (string, required)
    Recipient phone number in E.164 format (e.g. +390000000000).
    Example: "+390000000000"

  - `language` (string, required)
    Language code of the authentication template to use (e.g. it, en). See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages). Falls back to the template's default language if not found.
    Example: "it"

  - `templateId` (integer, required)
    Identifier of the authentication template to use.
    Example: 1

  - `otp` (string, required)
    The one-time password to include in the message (max 15 characters, as per Meta authentication template restrictions).
    Example: "123456"

  - `businessRelationId` (string,null)
    Optional One Platform Business Relation ID. If specified, consumption is attributed to this BRI.

  - `lra` (string,null)
    Local Registration Authority (LRA) identifier.

  - `reference` (object)
    Optional reference object for tracking. See [Reference Attribute](https://docs.namirial.app/products/sms/enterprise-documentation/developer-documentation/integration-guide/attribute-reference) for details.

  - `reference.service` (string,null)
    Identifies the product or service sending the message. Required if action or key are specified.

  - `reference.action` (string,null)
    Describes the specific action for the selected service (e.g. 2FA, AUTH).

  - `reference.key` (string,null)
    Custom tracking key for internal processes.

## Response 200 fields (application/json):

  - `messageId` (string)
    Unique identifier of the sent message.
    Example: "3425151601"

## Response 400 fields (application/json):

  - `type` (string)
    Exception type identifier.

  - `code` (integer)
    Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list.

  - `message` (string)
    Human-readable error description.

  - `errorDetails` (array,null)
    Additional validation error details, present on constraint violations.

  - `errorDetails.field` (string)
    The field that failed validation.

  - `errorDetails.message` (string)
    Validation error message.

## Response 401 fields (application/json):

  - `type` (string)
    Exception type identifier.

  - `code` (integer)
    Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list.

  - `message` (string)
    Human-readable error description.

  - `errorDetails` (array,null)
    Additional validation error details, present on constraint violations.

  - `errorDetails.field` (string)
    The field that failed validation.

  - `errorDetails.message` (string)
    Validation error message.


