template_send - Whatsapp

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.

MethodDetails
Stream TokenPass your token directly in the Authorization header value (not as a Bearer token).

Headers

HeaderRequiredDescription
AuthorizationYesThe stream token that verifies your access to the API.
Content-TypeYesMust 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:

FieldTypeRequiredDescription
senderstringYesThe sender's identifier, typically a WhatsApp-registered phone number (e.g., "447404751731").
eventstringYesThe name of the predefined WhatsApp event template to trigger (e.g., "oracle_cart_abandonment_1_no_buttons").
recipientsarray[object]YesAn array of recipient objects, each containing contact details, template variable values, and optional conversation routing.

Recipient Object:

FieldTypeRequiredDescription
recipient_keystringYesAn encrypted key identifying the recipient. This is used instead of a plain phone number for WhatsApp event sends.
template_variablesobjectYesA 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_infoobjectNoOptional routing information for the resulting conversation in the inbox.

Conversation Info Object:

FieldTypeRequiredDescription
teamarray[string]NoA list of team identifiers to assign the conversation to (e.g., ["dev-b"]).
agentarray[string]NoA 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.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
recipients
array of objects
recipients
string
Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json