דלג לתוכן הראשי
POST
/
whatsapp
/
templates
/
send
curl --request POST \
  --url https://{projectID}.texterchat.com/server/api/v2/whatsapp/templates/send \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "templateName": "inbox_marketing_98",
  "to": "972521234567"
}
'
{
  "success": true,
  "text": "Hi John.\nThis is an example of a template body with 2 variables.",
  "sentAsSessionMessage": false,
  "messageId": "690883c5962e17ab3033f92f"
}

הרשאות

Authorization
string
header
נדרש

API token generated in Texter: gear icon → Developers → API Tokens. When creating a token, assign it the scopes required by the endpoints you plan to call - each endpoint lists its required scopes.

גוף

application/json
templateName
string
נדרש

The template's unique name (ID) to send

Pattern: ^[a-zA-Z0-9_-]+$
to
string
נדרש

Recipient's phone number

from
string

The sender's WhatsApp account number. If not provided while multiple channels exist, the template is sent from the default channel

language
string

Template localization code to send (e.g. en, he). Auto-selected when the template has a single localization

body
string[]

Values for template body variables ({{1}}, {{2}}, ...) in order. Required if the template includes variables. Values must not contain line breaks, tabs, or 5+ consecutive spaces

header
object

Header media to use when sending (overrides the template default): type + url, plus filename for documents

setChat
object

Data to update on the chat when sending

buttons
object[]

Button payload values. Required if the template includes a variable in a URL button (inject the variable value) or was made with a Flow form. Non-English values for URL payloads should be URL-encoded

replyAction
object

Defines behavior after the recipient replies (overrides the template defaults)

sessionMessage
object

Attempt to send as a regular session message instead of a template when the 24-hour window is open (no template fee)

bulkReportTitle
string

Groups individual API calls into a single entry in the Bulk Reports dashboard. Use a consistent title across multiple requests to aggregate their statistics under one report

Required string length: 1 - 255
saveBody
string[]

Replace the actual template parameters in the database with these values (useful for sensitive data like OTP codes)

ignoreExcessParameters
boolean

If true, extra parameters in body are ignored instead of failing the request

whitespaceAbsentParameters
boolean

Replace missing parameters with a single whitespace instead of failing

skipHeaderFileURLCheck
boolean

Skip validation (HEAD request) of header media URL accessibility

skipChatConditions
object

Skip sending entirely when the chat is currently in one of the given statuses

skipReplyActionChatConditions
object

Skip applying the reply action when the chat is currently in one of the given statuses

תגובה

The result of the send operation. Note: an unsubscribed recipient also returns HTTP 200 but with success: false

success
boolean

Whether the template message was successfully sent

text
string

The final rendered message text after inserting all variable values

sentAsSessionMessage
boolean

Whether the message was sent as a session message instead of a template message

messageId
string

Unique identifier of the message created in Texter

error
string

Error description, present when success is false