Skip to main content

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.

File IconSending WhatsApp messages by template ID

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"
}
}
{
"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​

ParameterData typeRequirementDescription
messageIdstringOptionalInternal identifier of an outgoing message. An external customer system or edna Pulse generates it when sending the message. Maximum string length: 256 characters.
senderstringRequiredSignature name.

To learn the signature name, use the API method that retrieves the list of channels — the subject parameter. File IconReceiving list of channels
phonestringRequiredRecipient address: phone number.

To learn the recipient address, use the API method that requests recipient data — the addresses.address parameter. File IconRequesting client data
templateIdnumberRequiredTemplate identifier.

To learn the template identifier, use the API method that retrieves the list of templates — the id parameter. File IconRetrieving list of templates
textVariablesarray of stringsRequired if the template contains variablesVariable values in the template message.
buttonVariablesarray of stringsRequired if the template contains buttons with dynamic linksVariable values for buttons with dynamic links in the template message. A WhatsApp message template can contain up to two link buttons.
headerVariablesarray of stringsRequired if the template header contains a variableVariable value in the template message header. The header can contain only one variable.
attachmentobjectOptionalObject with attachment information.
attachment.urlstringRequired if the attachment parameter isn’t emptyLink to an attachment: image, file, video, or audio.
attachment.namestringRequired if the attachment parameter isn’t emptyName of the image, file, video, or audio. Maximum length: 70 characters.
optionsobjectOptionalObject with additional message sending settings.
options.commentstringOptionalText comment for the message. The parameter value appears in the message report.
options.sendDelaystringOptionalPeriod in ISO 8601 format (for example, PT10H15M48S) before which the message isn’t sent. Used for scheduled sending.
options.prioritystringOptionalIndicates the message priority.
Possible values:
- LOW — low priority;
- NORMAL — medium priority, the default value;
- HIGH — high priority;
- REALTIME — real-time delivery.
options.useMarketingMessagesApibooleanOptionalThe 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. File IconHow to activate Marketing Messages API for WhatsApp
options.messageActivitySharingbooleanOptionalThe 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. File IconHow 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​

ParameterData typeDescription
messageIdstringInternal identifier of an outgoing message. An external customer system or edna Pulse generated it when sending the message.
phonestringRecipient address: phone number.

Errors​

CodeErrorDescriptionPossible comments
400mm-api-options-invalid-combinationIncompatible 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.