Description
Summary: Sends event-based WhatsApp template messages to one or more recipients via the TextPeak Streams API. Details: This endpoint triggers a predefined WhatsApp event template (identified by the event field) and delivers it to the specified recipients. Each recipient is identified by an encrypted recipient_key rather than a plain phone number, and can include personalized template_variables for dynamic content substitution as well as conversation_info to route the resulting conversation to specific teams and agents. This is ideal for outbound WhatsApp campaigns such as cart abandonment reminders, promotional notifications, or transactional alerts. 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 containing a sender, an event template identifier, and an array of recipients with their personalized template variables and conversation routing information.
Top Level:
| Field | Type | Required | Description |
|---|---|---|---|
sender | string | Yes | The sender's identifier, typically a WhatsApp-registered phone number (e.g., "447404751731"). |
event | string | Yes | The name of the predefined WhatsApp event template to trigger (e.g., "oracle_cart_abandonment_1_no_buttons"). |
recipients | array[object] | Yes | An array of recipient objects, each containing contact details, template variable values, and optional conversation routing. |
Recipient Object:
| Field | Type | Required | Description |
|---|---|---|---|
recipient_key | string | Yes | An encrypted key identifying the recipient. This is used instead of a plain phone number for WhatsApp event sends. |
template_variables | object | Yes | A key-value map of template placeholder positions to their substitution values for this recipient (e.g., {"1": "John", "2": "Doe"}). Keys correspond to numbered placeholders in the WhatsApp template. |
conversation_info | object | No | Optional routing information for the resulting conversation in the inbox. |
Conversation Info Object:
| Field | Type | Required | Description |
|---|---|---|---|
team | array[string] | No | A list of team identifiers to assign the conversation to (e.g., ["dev-b"]). |
agent | array[string] | No | A list of agent email addresses to assign the conversation to (e.g., ["[email protected]"]). |
Examples
This endpoint has a saved example demonstrating usage:
- Whatsapp template send — Sending a WhatsApp event template message with recipient key, template variables, and conversation routing.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||