template_send - SMS

Description

Summary: Sends template-based messages to one or more recipients via the TextPeak Streams API. Details: This endpoint allows you to send messages using a predefined message template with dynamic variable substitution. Instead of providing raw message content, you supply a message_template string containing placeholders and a template_variables object per recipient that maps placeholder names to their values. This is ideal for bulk personalized messaging such as OTP codes, welcome messages, or notifications where the message structure is consistent but individual values differ. 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, a message template, and an array of recipients with their personalized template variables.

Top Level:

FieldTypeRequiredDescription
senderstringYesThe sender's identifier. Can be a name, phone number, or any other identifier.
message_templatestringYesThe message template string containing placeholders for dynamic variable substitution (e.g., "Hello {{first_name}}, your code is {{code}}").
recipientsarray[object]YesAn array of recipient objects, each containing contact details and template variable values.

Recipient Object:

FieldTypeRequiredDescription
internal_idstringYesA unique identifier for the message, used for tracking and deduplication.
recipient_phonestringYesThe phone number of the message recipient, in international format (e.g., "972524265292").
template_variablesobjectYesA key-value map of template placeholder names to their substitution values for this recipient (e.g., {"first_name": "John", "code": "1234"}).

Examples

This endpoint has a saved example demonstrating usage:

  • template_send - SMS — Sending a template-based message via SMS channel.
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