Sending WhatsApp messages by template identifier (deprecated)
Last updated: 16 October 2026
Use the /api/v1/out-messages/whatsapp/template method to send messages to the WhatsApp channel by template ID templateId.
warning
The /api/v1/out-messages/whatsapp/template method is deprecated but still available.
For BSUID support, we recommend using the new /api/v2/out-messages/whatsapp/template method.
Call the method
To send a message to the WhatsApp channel using the /api/v1/out-messages/whatsapp/template method, send a POST request to https://app.edna.io/api/v1/out-messages/whatsapp/template.
Request format
{
"messageId": "string",
"sender": "string",
"phone": "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 examples
Text message
{
"sender": "RETAIL_WA",
"phone": "35700000000",
"templateId": 81,
"options": {
"comment": "2025-08-04T13:00:48.567Z"
}
}
Text message delivered via Marketing Messages API with optimization enabled
{
"sender": "RETAIL_WA",
"phone": "77771234567",
"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
{
"messageId": "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 | Requirement | Description |
|---|---|---|---|
messageId | string | Optional | Internal identifier of an outgoing message. An external customer system or edna Pulse generates it when sending the message. Maximum string length: 256 characters. |
sender | string | Required | Signature name. To learn the signature name, use the API method that retrieves the list of channels — the subject parameter.
Receiving list of channels |
phone | string | Required | Recipient address: phone number. To learn the recipient address, use the API method that requests recipient data — the addresses.address parameter.
Requesting client data |
templateId | number | Required | Template identifier. To learn the template identifier, use the API method that retrieves the 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 contains 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 the template header contains a variable | Variable value in the template message header. The header can contain only one variable. |
attachment | object | Optional | Object with attachment information. |
attachment.url | string | Required if the attachment parameter isn’t empty | Link to an attachment: image, file, video, or audio. |
attachment.name | string | Required if the attachment parameter isn’t empty | Name of the image, file, video, or audio. Maximum length: 70 characters. |
options | object | Optional | Object with additional message sending settings. |
options.comment | string | Optional | Text comment for the message. The parameter value appears in the message report. |
options.sendDelay | string | Optional | Period in ISO 8601 format (for example, PT10H15M48S) before which the message isn’t sent. Used for scheduled sending. |
options.priority | string | Optional | Indicates the message priority.
Possible values: - LOW — low priority;
- NORMAL — medium priority, the default value;
- HIGH — high priority;
- REALTIME — real-time delivery. |
options.useMarketingMessagesApi | boolean | Optional | The parameter determines how a marketing message is delivered — through Marketing Messages API or Cloud API.
Possible values: - true — through Marketing Messages API;
- false — through Cloud API.
How to activate Marketing Messages API for WhatsApp |
options.messageActivitySharing | boolean | Optional | The parameter enables optimization of marketing message delivery through Marketing Messages API and determines whether Meta* can analyze message data.
Possible values: - true — optimization is enabled: Meta* can read the message and decide whether to deliver it to the recipient.
- false — optimization is disabled: Meta* can’t access the message content and doesn’t help decide whether to deliver it.
How to activate Marketing Messages API for WhatsApp |
Response format
{
"messageId": "string",
"phone": "string"
}
Response example
{
"messageId": "01987f4a-069e-730e-bf59-cedc1e63349",
"phone": "77771234567"
}
Response parameters
| Parameter | Data type | Description |
|---|---|---|
messageId | string | Internal identifier of an outgoing message. An external customer system or edna Pulse generated it when sending the message. |
phone | string | Recipient address: phone number. |
Errors
| Code | Error | Description | Possible comments |
|---|---|---|---|
400 | mm-api-options-invalid-combination | Incompatible settings combination when sending a WhatsApp message through Marketing Messages API. | Cannot use messageActivitySharing=true when useMarketingMessagesApi=false — message delivery optimization is available only when sending a message through Marketing Messages API. |