1. Auth (OTP/Verification)
RASL
  • Introduction
  • Authentication
  • Changelog
  • Messages
    • Overview
    • Send Text Message
      POST
    • Send Media Message
      POST
    • Send Template Message
      POST
    • Send Interactive Message
      POST
    • List Messages
      GET
    • Get Message
      GET
  • Auth (OTP/Verification)
    • Overview
    • Send OTP
      POST
    • Verify OTP
      POST
    • Resend OTP
      POST
    • Check OTP Status
      POST
    • List Authentication Templates
      GET
  • Templates
    • Overview
    • List Templates
      GET
    • Get Template
      GET
    • Sync Templates
      POST
  • Contacts
    • Overview
    • List Contacts
      GET
    • Create Contact
      POST
    • Get Contact
      GET
    • Update Contact
      PATCH
    • Delete Contact
      DELETE
    • Batch Create Contacts
      POST
    • Batch Delete Contacts
      DELETE
  • Groups
    • Overview
    • List Groups
    • Create Group
    • Get Group
    • Update Group
    • Delete Group
    • Add Contacts to Group
    • Remove Contacts from Group
  • Account
    • Overview
    • Get Account Info
    • Get Usage Statistics
    • Get Plan Limits
  • Integrations
    • Webhook Format Reference
    • N8N Webhook Integration
    • eCommerce Webhook Integration
      • Webhook Listener
      • WooCommerce Webhook Setup
Dashboard
Support
Support
  • Email
  • WhatsApp
Dashboard
Support
Support
  • Email
  • WhatsApp
Instagram
  1. Auth (OTP/Verification)

Send OTP

POST
https://getrasl.io/api/v2/auth/send-otp

Send a WhatsApp authentication template for OTP, verification codes, or two-factor authentication.#

This endpoint sends an OTP code via a pre-approved AUTHENTICATION category WhatsApp template. It handles contact auto-creation if the phone number doesn't exist in your contacts, and stores the OTP for subsequent verification via /auth/verify.
📌
Important | No 24-Hour Restrictions
Template messages can be sent at any time, regardless of the customer service window. Unlike simple text and media messages, approved templates are not restricted by Meta's 24-hour policy. They are the only message type that can be sent outside a customer service window, making them perfect for marketing campaigns, notifications, and re-engaging customers after extended periods of inactivity.

Required Scope#

messages:send

Auto-Contact Creation#

If no contact_id is provided and the phone number doesn't match an existing contact:
A new contact is auto-created with the phone number
Requires default lead status, source, and assignee configured in Application settings
Subject to the tenant's contact limit (returns FEATURE_LIMIT_EXCEEDED if exceeded)

Template Requirements#

Template must be APPROVED status
Template must be AUTHENTICATION category
First body parameter {{1}} receives the OTP code
Second body parameter {{2}}, if present, receives the expiry minutes
URL buttons containing otp{{1}} will automatically receive the OTP code

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Header Params

Body Params application/jsonRequired

Example
{
    "phone": "+201XXXXXXXXX",
    "template_name": "otp_verification",
    "language": "en",
    "code": "123456",
    "expiry_minutes": 10,
    "purpose": "authentication"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://getrasl.io/api/v2/auth/send-otp' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "phone": "+201XXXXXXXXX",
    "template_name": "otp_verification",
    "language": "en",
    "code": "123456",
    "expiry_minutes": 10,
    "purpose": "authentication"
}'

Responses

🟢200Success
application/json
Body

Example
{
    "success": true,
    "data": {
        "message_id": "wamid.HBgMMjAxMDIzMDAwNDg5FQIAERgSRTNFNjQ5MUM0M0UxMzc2MDFEAA==",
        "contact_id": 1,
        "phone": "201XXXXXXXXX",
        "template_name": "otp_verification",
        "language": "en",
        "code_sent": true,
        "expiry_minutes": 10,
        "expires_at": "2026-01-01T08:03:14+00:00",
        "status": "sent",
        "sent_at": "2026-01-01T07:53:15+00:00"
    },
    "message": "Authentication code sent successfully. Please verify using /auth/verify endpoint.",
    "meta": {
        "request_id": "23dab666-3ed6-4d15-86b2-924b9cfdd18c",
        "timestamp": "2026-01-01T07:53:15+00:00"
    }
}
🟠401UNAUTHORIZED
🟠403INSUFFICIENT_SCOPE
🟠403FEATURE_LIMIT_EXCEEDED
🟠403CONTACT_OPTED_OUT
🟠404NOT_FOUND
🟠422VALIDATION_ERROR
🟠422WHATSAPP_NOT_CONFIGURED
🟠429RATE_LIMIT_EXCEEDED
🔴500INTERNAL_ERROR
🔴500MESSAGE_SEND_FAILED
Previous
Overview
Next
Verify OTP
Built with