WhatsApp - Send OTP Template


Endpoint

For sending WhatsApp templates, the base url is:

https://rebuetext.com/api/v1

Method

Method URI
POST /whatsapp/send-template

Request Params

Param Type Description
sender_phone string(required) Your approved WhatsApp Business Phone Number (e.g., "254741226412").
phone string(required) Recipient's Phone Number starting with the country code (e.g., "254708XXXXXX").
template_name string(required) The exact name of your approved Meta template (e.g., "otp" or "auth_code").
language string(required) The language code of the template (e.g., "en", "en_US").
correlator string(optional) A Unique identifier generated by YOUR system. We forward delivery receipts together with your correlator to help you map statuses back to your database.
delivery_endpoint string(optional) Your webhook endpoint where we will send real-time delivery and read receipts for this specific message. Click HERE for the payload structure.
body_variables array(optional) An array of strings to dynamically replace placeholders (1) in your template's body. For OTPs, this is usually the authentication code.
button_variables array(optional) An array of strings to dynamically replace variables inside buttons (specifically URL or OTP Autofill/Copy buttons). Must be provided in the exact order the buttons appear in the template.

Sample Request Header

{
    "Content-type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer 123456789"
}

Sample Request Body

To send a batch of messages, simply pass an array of message objects. A single request can process between 1 and 100 messages.

{info} Even if you are sending a single message, the JSON body must be wrapped in an array [ ].

[
    {
        "sender_phone": "254741226412",
        "phone": "254708361797",
        "template_name": "otp",
        "language": "en",
        "correlator": "AUTH-443",
        "delivery_endpoint": "https://yourdomain.com/webhooks/whatsapp",
        "body_variables": [
            "849201" 
        ],
        "button_variables": [
            "849201" 
        ]
    }
]

Sample Success Response

StatusCode 200

Content

{
    "status": true,
    "batch_id": "820f15fc-9ab0-4393-950a-7c3e50f6f345",
    "results": [
        {
            "status": true,
            "message": "Template queued successfully",
            "data": {
                "sender_phone": "254741226412",
                "phone": "254708361797",
                "template_name": "otp",
                "correlator": "AUTH-443",
                "batch_id": "820f15fc-9ab0-4393-950a-7c3e50f6f345",
                "message_id": 144,
                "currency": "KES",
                "cost_minor": 200,
                "cost": 2.00,
                "created_at": "2026-06-27 21:55:00"
            }
        }
    ]
}

Playground

Sample Error Response

If a message fails validation (e.g., missing variables or insufficient balance), the API will successfully process the rest of the batch, but return status: false with the exact error for the failed item.

StatusCode 200

{
    "status": true,
    "batch_id": "820f15fc-9ab0-4393-950a-7c3e50f6f345",
    "results": [
        {
            "status": false,
            "message": "Template Validation Failed: Buttons require exactly 1 variable(s), but 0 provided",
            "data": {
                "phone": "254708361797",
                "correlator": "AUTH-443"
            }
        }
    ]
}

Delivery Receipts Structure

If you provide a delivery_endpoint in your request, we will automatically POST real-time status updates back to your server as Meta processes the message.

{info} The status field can return sent, delivered, read, or failed.

{
    "status": "delivered",
    "message_id": 144,
    "correlator": "AUTH-443",
    "batch_id": "820f15fc-9ab0-4393-950a-7c3e50f6f345",
    "phone": "254708361797",
    "error": null,
    "timestamp": "2026-06-27T21:55:03+03:00"
}

{danger} The Generated Auth Token gives a person full access to your account balances. Do not share it under any circumstance.