Integrate MSG91 into the workflow. Send SMS through approved DLT templates, send, verify and resend OTPs, send WhatsApp templates and session replies, check WhatsApp prepaid balance, and pull SMS delivery logs. Can also run workflows when MSG91 reports SMS delivery or a customer sends a WhatsApp message. Indian SMS must match a DLT-approved template exactly, so SMS and OTP always go through an MSG91 template. Requires an MSG91 authkey.
Send an SMS to one or many numbers through an MSG91 SMS template (Flow API), filling the template's variables. In India every SMS must match a DLT-approved template exactly (TRAI rule): register the template on a DLT portal, add it in MSG91 with its DLT Template ID, and fill only its ##variables##. Free-form text is blocked by operators.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
templateId | string | Yes | MSG91 SMS template ID (from SMS > Templates). The template carries the DLT Template ID and sender ID, so its approved text is what gets sent. |
mobiles | string | No | Recipient numbers with country code and no "+", comma-separated (e.g. 919876543210). Required unless Recipients is set. |
variables | json | No | Values for the template variables, keyed exactly as in the template (case-sensitive), e.g. {"var1": "Asha", "var2": "10:30"}. Sent to every number in Mobile Numbers. |
recipients | json | No | Per-recipient values instead of Mobile Numbers + Variables: an array like [{"mobiles": "919876543210", "var1": "Asha"}]. Optional tracking keys such as CRQID are echoed back in delivery webhooks. |
shortUrl | boolean | No | Shorten URLs in the message (short_url) |
shortUrlExpiry | number | No | Short URL expiry in seconds |
realTimeResponse | boolean | No | Ask MSG91 for a real-time response (realTimeResponse=1) |
| Parameter | Type | Description |
|---|
requestId | string | Request ID of the send. Pass it to Get SMS Report to check delivery. |
type | string | MSG91 result type, "success" when accepted |
Generate and send a one-time password by SMS with an MSG91 OTP template. MSG91 stores the code and its expiry, so check it later with Verify OTP. In India the OTP template must match a DLT-approved template exactly.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
templateId | string | Yes | MSG91 OTP template ID (from the OTP section). The template must contain ##OTP## and match its DLT-approved text. |
mobile | string | Yes | Mobile number with country code, e.g. 919876543210 |
otpLength | number | No | OTP length, 4 to 9 digits (default 4) |
otpExpiry | number | No | Minutes before the OTP expires, 1 to 10080 (default 15) |
otp | string | No | Your own OTP value. Leave empty so MSG91 generates one. |
unicode | boolean | No | Set for non-English templates |
templateParams | json | No | Values for template variables other than the OTP, keyed exactly as in the template (case-sensitive), e.g. {"Param1": "Asha"} |
| Parameter | Type | Description |
|---|
requestId | string | Request ID of the OTP send (Send OTP only) |
type | string | MSG91 result type, "success" when accepted |
message | string | MSG91 message, e.g. "retry send successfully" (Resend OTP only) |
Check the OTP a user entered against the one MSG91 sent to that number. Returns verified true only on a match; a wrong or expired code returns verified false with the reason.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
mobile | string | Yes | The mobile number the OTP was sent to, with country code |
otp | string | Yes | The code the user entered |
| Parameter | Type | Description |
|---|
verified | boolean | True only when MSG91 confirmed the OTP |
type | string | MSG91 result type: success or error |
message | string | MSG91 message, e.g. "OTP verified success", "OTP expired" or "OTP not match" |
Resend the same OTP to a number that already got one from Send OTP, by SMS or voice call. MSG91 allows at most 2 retries.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
mobile | string | Yes | The mobile number the OTP was first sent to, with country code |
retryType | string | No | "text" to resend by SMS or "voice" for a voice call (MSG91 default: voice) |
| Parameter | Type | Description |
|---|
requestId | string | Request ID of the OTP send (Send OTP only) |
type | string | MSG91 result type, "success" when accepted |
message | string | MSG91 message, e.g. "retry send successfully" (Resend OTP only) |
Send an approved WhatsApp template message from your MSG91 WhatsApp number to one or many customers. Templates start a conversation; free-form replies need Send WhatsApp Message inside the 24-hour session.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
integratedNumber | string | Yes | Your WhatsApp number integrated with MSG91, with country code |
templateName | string | Yes | Name of an approved WhatsApp template on that number |
languageCode | string | Yes | Template language code, e.g. en or en_US |
recipients | string | No | Recipient numbers with country code, comma-separated. Required unless To and Components is set. |
components | json | No | Template variable values, e.g. {"body_1": {"type": "text", "value": "Asha"}, "header_1": {"type": "image", "value": "https://..."}} |
toAndComponents | json | No | Per-recipient values instead of Recipients + Components: [{"to": ["919876543210"], "components": {"body_1": {"type": "text", "value": "Asha"}}}] |
| Parameter | Type | Description |
|---|
requestId | string | Request ID of the bulk template send |
status | string | Request status, "success" when accepted |
message | string | MSG91 note, e.g. "Your request is in process, check delivery reports for status" |
Send a free-form WhatsApp text reply from your MSG91 WhatsApp number. Works only inside the 24-hour session that starts when the customer messages you; otherwise send a template.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
integratedNumber | string | Yes | Your WhatsApp number integrated with MSG91, with country code |
recipientNumber | string | Yes | Customer number with country code, e.g. 919876543210 |
text | string | Yes | Message text, up to 4096 characters |
| Parameter | Type | Description |
|---|
messageUuid | string | MSG91 message UUID |
status | string | Request status, "success" when accepted |
message | string | MSG91 note, e.g. "Your request is in process, please check delivery report for status" |
Get the prepaid WhatsApp balance and plan status of an MSG91 WhatsApp number. Use it before a large template send to make sure the balance covers it.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
integratedNumber | string | Yes | Your WhatsApp number integrated with MSG91, with country code |
| Parameter | Type | Description |
|---|
status | string | Request status, "success" when found |
planStatus | string | WhatsApp plan status, e.g. active |
number | string | The integrated WhatsApp number |
prepaidBalance | number | Prepaid WhatsApp balance left on the number |
Get SMS delivery logs (status, number, delivery time) for a date range, or for one send by its request ID. The range can be at most 3 days and must start within the last 3 days.
| Parameter | Type | Required | Description |
|---|
authKey | string | Yes | MSG91 authkey, from the MSG91 dashboard under Authkey |
startDate | string | Yes | Start date, YYYY-MM-DD, within the last 3 days |
endDate | string | Yes | End date, YYYY-MM-DD, at most 3 days after the start date |
requestId | string | No | Request ID returned by Send SMS, to get only that send |
fields | string | No | Comma-separated fields to return (no spaces), e.g. status,telNum,deliveryDate,deliveryTime,requestId,failureReason,credit,DLT_TE_ID |
limit | number | No | Maximum rows to return, up to 10000 (MSG91 default 1000) |
| Parameter | Type | Description |
|---|
logs | array | One row per message. By default each row has status, telNum, requestDate, deliveryDate, deliveryTime and sentDateTime; Fields changes which keys are returned. |
↳ status | string | Delivery status, e.g. Delivered |
↳ telNum | string | Recipient number |
↳ requestDate | string | When the send was requested |
↳ deliveryDate | string | Delivery date (YYYY-MM-DD) |
↳ deliveryTime | string | Delivery time (HH:mm:ss) |
↳ sentDateTime | string | When the SMS was sent to the operator |
total | number | Total rows matching the query |
paginationToken | string | Token MSG91 returns for large result sets |