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 send from a custom sender ID, link your WABA account in the Modawer Portal. For OTP messages, your WhatsApp Business Account (WABA) must be verified. Utility and marketing templates can be sent from a linked account without completing the business verification process.

Custom sender setup

To send from your own WhatsApp sender, connect a WhatsApp API account in the Modawer Portal. See Link WABA Account for the full setup flow.
  • Create or select a WhatsApp Business Account (WABA).
  • Add and verify a phone number that can receive a verification code.
  • Use a WhatsApp business display name that matches your brand.
  • Keep your company details ready, including company name, address, business registration document, official HTTPS website, and business email.
  • Complete business verification for OTP templates.
If you only need utility or marketing templates, you can start sending from a linked WhatsApp account without completing business verification.

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