Skip to main content

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.

Endpoint

FieldValue
MethodPOST
Path/api/messages/send-otp
Content-Typeapplication/json
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.
To use a custom sender ID, please link your WhatsApp Business Account (WABA).

Request body

{
  "recipient": "9647701234567",
  "otp": "123456",
  "channels": ["WhatsApp"]
}
FieldTypeDescription
recipientstringPhone number that receives the OTP message.
otpstringOne-time password value inserted into the otp_code_1 authentication template.
channelsMessageChannel[]Optional delivery channels. Defaults to ["WhatsApp"]. Supported values are "WhatsApp" and "Telegram".

Required header

X-API-KEY: your-app-token

Success response

{
  "queued": true
}

cURL example

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

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();