Sending Messages by WhatsApp Template ID
Last updated: 23 July 2026
To send messages to the WhatsApp channel by the template ID templateId, the api/v2/out-messages/whatsapp/template method is used.
info
The api/v2/out-messages/whatsapp/template method is related to the new version of the API and is recommended for use to support BSUID.
The previous version of the API method, api/v1/out-messages/whatsapp/template, remains available for use.
Calling the method
To send a message to the WhatsApp channel using the api/v2/out-messages/whatsapp/template method, send a POST request to the URL https://app.edna.io/api/v2/out-messages/whatsapp/template.
Request format
{
"outMessageId": "string",
"from": "string",
"to": {
"value": "string",
"type": "string"
},
"templateId": number,
"textVariables": [
"string",
"string",
"string"
],
"buttonVariables": [
"string",
"string"
],
"headerVariables": [
"string"
],
"attachment": {
"url": "string",
"name": "string"
},
"options": {
"comment": "string",
"sendDelay": "string",
"priority": "string",
"useMarketingMessagesApi": boolean,
"messageActivitySharing": boolean
}
}
Request example
Text message
{
"from": "RETAIL_WA",
"to": {
"value": "DE.1234567890123456789",
"type": "WHATSAPP_BSUID"
},
"templateId": 81,
"options": {
"comment": "2025-08-04T13:00:48.567Z"
}
}
Text message delivered via Marketing Messages API with optimization enabled
{
"sender": "RETAIL_WA",
"phone": "35700000000",
"templateId": 81,
"options": {
"comment": "2025-08-04T13:00:48.567Z",
"useMarketingMessagesApi": true,
"messageActivitySharing": true
}
}
The message with the document in the attachment
{
"sender": "RETAIL_WA",
"phone": "35700000000",
"templateId": 96,
"attachment": {
"url": "https://tourism.gov.in/sites.pdf",
"name": "example"
},
"options": {
"comment": "promotion"
}
}
Delayed message containing a document in an attachment, variables in the header, message text, and dynamic link buttons
{
"outMessageId": "01987f4a-069e-730e-bf59-cedc1e63349",
"sender": "RETAIL_WA",
"phone": "35700000000",
"templateId": 98,
"textVariables": [
"Alex",
"10.05",
"Happy Birthday"
],
"buttonVariables": [
"3FgSD",
"KNsr6"
],
"headerVariables": [
"Good Morning"
],
"attachment": {
"url": "https://tourism.gov.in/sites.pdf",
"name": "offer"
},
"options": {
"comment": "2025-08-15T12:12:16.984Z",
"sendDelay": "PT10H15M47S",
"priority": "NORMAL"
}
}
Request parameters
| Parameter | Data type | Character | Description |
|---|---|---|---|
outMessageId | string | Optional | The internal ID of the message. |
from | string | Required | Signature name.
To find out the name of the signature, use the API method to get a list of channels — the subject parameter.
Receiving List of Channels |
to | object | Required | An object containing information about the recipient's identifier. |
to.value | string | Required | Recipient ID.
To find out the recipient's ID, use the API method to request recipient data — the addresses.address parameter.
Requesting Client Data |
to.type | string | Required | Recipient ID type.
Possible values: - PHONE — a telephone number;
- WHATSAPP_BSUID — Business-Scoped User ID (BSUID);
- WHATSAPP_PARENT_BSUID — Parent Business-Scoped User ID (Parent BSUID). |
templateId | integer | Required | Template ID.
To find out the template ID, use the API method to get a list of templates — the id parameter.
Retrieving List of Templates |
textVariables | array of strings | Required if the template contains variables | Variable values in the template message. |
buttonVariables | array of strings | Required if the template has buttons with dynamic links | Variable values for buttons with dynamic links in the template message. A WhatsApp message template can contain up to two link buttons. |
headerVariables | array of strings | Required if there is a variable in the template header | The value of the variable in the template message header. The header can contain only one variable. |
attachment | object | Optional | Information about the attachment. |
attachment.url | string | Required if the attachment parameter is not empty | The link to the attachment is an image, file, video, or audio. |
attachment.name | string | Required if the attachment parameter is not empty | The name of the image, file, video, or audio. The maximum length is 70 characters. |
options | object | Optional | Used for additional message sending settings. |
options.comment | string | Optional | Text comment to the message. The parameter value is displayed in the message report. |
options.sendDelay | string | Optional | Time interval in the ISO 8601 durations date format (for example, `PT10H15M48S'), before which the message will not be sent. Used for delayed shipping.
|
options.priority | string | Optional | Used to indicate the priority of messages.
Possible values: - LOW — low priority;
- NORMAL — medium priority, default value;
- HIGH — high priority;
- REALTIME — real-time delivery. |
useMarketingMessagesApi | boolean | Optional | This parameter determines how marketing messages are delivered: Marketing Messages API or Cloud API.
Possible values: - true — via Marketing Messages API;
- false — via Cloud API.
How to Activate Marketing Messages API for WhatsApp |
messageActivitySharing | boolean | Optional | This parameter enables optimization of marketing message delivery via the Marketing Messages API and determines whether Meta can analyze message data.
Possible values: - true — optimization enabled: Meta can read the message and decide whether to deliver it to the recipient.
- false — optimization disabled: Meta doesn't have access to the message content and doesn't participate in the delivery decision.
How to Activate Marketing Messages API for WhatsApp |
Response format
{
"outMessageId": "string",
}
Response example
{
"outMessageId": "01987f4a-070e-730e-bf59-cedc1e63350",
}
Response parameters
| Parameter | Data type | Description |
|---|---|---|
outMessageId | string | The internal ID of the message. |
Errors
| Code | Error | Description | Possible comments |
|---|---|---|---|
400 | mm-api-options-invalid-combination | The incompatible combination of settings when sending a WhatsApp message via the Marketing Messages API. | Cannot use messageActivitySharing=true when useMarketingMessagesApi=false — message delivery optimization is only available when sending messages via the Marketing Messages API. |