> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modawer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send OTP Message

> Queue a WhatsApp OTP message

## Endpoint

| Field        | Value                    |
| ------------ | ------------------------ |
| Method       | `POST`                   |
| Path         | `/api/messages/send-otp` |
| Content-Type | `application/json`       |

<Info>
  This endpoint sends OTP messages only through Modawer's official WhatsApp
  account. It is the easiest way to start sending OTP messages without linking
  your own WhatsApp sender.
</Info>

<Note>
  To send OTPs from your own connected WhatsApp Business account, see
  [Send OTP from Your WhatsApp Account](/messages/send-otp-whatsapp-account).
</Note>

## Request body

```json theme={null}
{
  "recipient": "9647701234567",
  "otp": "123456",
  "channels": ["WhatsApp"]
}
```

| Field       | Type               | Description                                                                                                 |
| ----------- | ------------------ | ----------------------------------------------------------------------------------------------------------- |
| `recipient` | `string`           | Phone number that receives the OTP message.                                                                 |
| `otp`       | `string`           | One-time password value inserted into the `otp_code_1` authentication template.                             |
| `channels`  | `MessageChannel[]` | Optional delivery channels. Defaults to `["WhatsApp"]`. Supported values are `"WhatsApp"` and `"Telegram"`. |

## Required header

```http theme={null}
X-API-KEY: your-app-token
```

## Success response

```json theme={null}
{
  "queued": true
}
```

## cURL example

```bash theme={null}
curl -X POST "https://modawer.com/api/messages/send-otp" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-app-token" \
  -d '{
    "recipient": "9647701234567",
    "otp": "123456",
    "channels": ["WhatsApp"]
  }'
```

## JavaScript example

```js theme={null}
const response = await fetch("https://modawer.com/api/messages/send-otp", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-KEY": "your-app-token",
  },
  body: JSON.stringify({
    recipient: "9647701234567",
    otp: "123456",
    channels: ["WhatsApp"],
  }),
});

const data = await response.json();
```
