Description
Summary: Sends a WhatsApp template message to one or more recipients via the TextPeak Streams API.
Details: This endpoint triggers the delivery of a pre-approved WhatsApp template message to a list of recipients. Template messages are structured messages registered with WhatsApp (e.g., welcome messages, appointment reminders, OTP notifications) and are identified by an event name. Each recipient can receive a personalized version of the template through dynamic template_variables that populate placeholders in the template's header, body, and footer sections. The sender field specifies the originating WhatsApp Business number. Authentication is performed via a stream token passed in the Authorization header.
Authentication & Scopes
Authentication is handled via a stream token provided in the Authorization header. No OAuth scopes are defined; access is granted or denied based on the validity of the token.
| Method | Details |
|---|---|
| Stream Token | Pass your token directly in the Authorization header value (not as a Bearer token). |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | The stream token that verifies your access to the API. |
Content-Type | Yes | Must be set to application/json. The API only accepts JSON-formatted request bodies. |
Parameters
This endpoint does not use path or query parameters.
Request Body
The request body is a JSON object specifying the sender, the template event, and the list of recipients with their personalized variables.
| Field | Type | Required | Description |
|---|---|---|---|
sender | string | Yes | The WhatsApp Business phone number used to send the template message, in international format (e.g., "447404751731"). |
event | string | Yes | The registered template event name that identifies which pre-approved WhatsApp template to use (e.g., "dialer_first_call_welcome"). |
recipients | array | Yes | An array of recipient objects. Each object defines a target recipient and the template variables to personalize the message for them. |
Recipient Object
| Field | Type | Required | Description |
|---|---|---|---|
internal_id | string | No | An optional internal identifier for the recipient, used for tracking or correlation on your side. |
recipient_phone | string | Yes | The recipient's phone number in international format (e.g., "972507445456"). |
template_variables | object | No | An object containing key-value pairs that populate dynamic placeholders in the template. Organized by template section. |
Template Variables Object
| Section | Type | Description |
|---|---|---|
HEADER | object | Key-value pairs for dynamic placeholders in the template header section (e.g., {"1": "John"}). |
BODY | object | Key-value pairs for dynamic placeholders in the template body section (e.g., {"1": "Order #1234", "2": "March 23"}). |
FOOTER | object | Key-value pairs for dynamic placeholders in the template footer section. |
Examples
This endpoint currently has no saved examples.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
200