Send Multi Template
The send Multi Template allows you to send the same template to multiple destinations in a single request.
This endpoint is very similar to send a template, the only difference is that some body parameters are now part of an array, allowing you to send them all at once.
This page assumes you know how to handle bodyVariable1-10, websiteVariable/2 and couponCode and what they mean. for more reference, see the send a template endpoint first.
More Remarks
You can only send template messages to private people, not groups.
If you send a template message to the client, and the client did not reply yet, and you want to send another message to him, you must use the template message again.
If your template has variables, you must provide all variables data (inside bodyVariable parameter inside the destinations).
The entire template body + variables should not exceed 1024 characters.
sendMultiTemplate endpoint doesn't allow you to send authentication code template.
For carousel template, headerType should be 1.
Settings:
URL | |||||
Method | JSON via POST | ||||
Header |
|
Body:
Parameter | Description / Example | Mandatory |
|---|---|---|
from | your WhatsApp account. international number without +. for example: 972771234567 | yes |
name | The template name | yes |
destinations | Array of objects that contains: to, bodyVariable1-10, websiteVariable, websiteVariable2 and couponCode It should be sent like this, depends on the variables you used when created the template. 'to' is required: [ { "to": "972501234567", "bodyVariable1": "Hello John", "bodyVariable2": "Special offer", "websiteVariable": "value1", "websiteVariable2": "value2", "couponCode": "SAVE20", "quickReplyX_id": "button-id" }, { "to": "972507654321", "bodyVariable1": "Hello Jane", "bodyVariable2": "Different offer", "websiteVariable": "param1=value2", "websiteVariable2": "param1=value2", "couponCode": "SAVE30", "quickReplyX_id": "button-id" } ] | yes |
headerType | 1 for none, 3 for image, 4 for video, 5 for document | yes |
headerLink | in case you used image/video/document header, this is the link for image or video or document limitation: image - 5 MB document - 100 MB video - 16 MB | only if you used 3/4/5 as headerType |
couponExpiration | in case you used coupon code in the template, and set 'true' for code expiration, here you put the GMT timestamp (seconds) for the date and time that the code will no longer be available.bare in mind that for Israel time you must add GMT+2 or GMT+3 | no |
pdfFilename | In case you used headerType as document, and provided a document link in headerLink, here you can put the filename that will show for the end user when receiving the PDF file. Priority: 1. if 'pdfFilename' is provided, it will be used. 2. if 'pdfFilename' is not provided by you, we will use the pdf file name from the headerLink URL directly. 3. if the headerLink filename is not available for any reason, we will put the default text: "קובץ מצורף - לחץ כאן" | no |
showRequest | You can get back in the response an object with all the request you sent (without the 'apiKey') default is off (0) 1 - enable | no |
localStorage | Whenever you provide headerLink url, we deliver this URL to WhatsApp. They download the link in order to deliver it with your template. If for any reason your file link is not accessible by Meta and open to the internet, you can request us to download the image and provide WhatsApp with alternative url to use, and not your own. This will download the file, save it in our servers locally, deliver a new link for WhatsApp to use and then remove the file instantly. default value is - 0 (disable) enable - 1
| no |
showBody | Whether or not to show the body in every item of the destination[] array. 1 = show 0 = dont show default is 0 ** For a long list, the entire 'body' in the response can be long, and the full response might reach very high MB size. so consider carefully if to enable the body in your response or not. | no |
carouselCardX_headerLink | X represent the card number (for example carouselCard1_headerLink) you must provide the full url of either the image (up to 5 MB) or a video (up to 16 MB) to send for the card. you must provide this URL for every card you used when creating the template. | Only if you send carousel template. |
carouselCardX_bodyVariable | X represents the card number (for example carouselCard1_bodyVariable). The variable must be up to 160 characters. You must provide this for each of the cards | Only if you send carousel template, and you added a variable in the card. |
carouselCardX_quickReply1_id | X represents the card number (for example carouselCard1_quickReply1_id). If a client clicked on a quick reply button in a carousel, you can provide the button id and get it back on the webhook. | no |
carouselCardX_quickReply2_id | X represents the card number (for example carouselCard1_quickReply2_id). If a client clicked on a quick reply button in a carousel, you can provide the button id and get it back on the webhook. | no |
Body example:
A sample request to send a multi template to 2 numbers that has 3 body variables
{
"from": "your-whatsapp-number",
"name": "welcome_to_the_jungle",
"headerType": 1,
"destinations": [
{
"to": "972501234567",
"bodyVariable1": "one",
"bodyVariable2": "two",
"bodyVariable3": "three",
"quickReply1_id": "button-1-id"
},
{
"to": "972509875654",
"bodyVariable1": "four",
"bodyVariable2": "five",
"bodyVariable3": "six"
}
],
"showRequest": 0,
"showBody": 1
}
Response:
{
"status": "OK",
"timestamp": 1757610296,
"from": "your-whatsapp-number",
"accepted": 2,
"rejected": 0,
"failed": 0,
"destinations": [
{
"unique": "19545c3deca25da-0a504082ac7ad12-oiksAeQWvDMRtBQ",
"to": "972501234567",
"body": "שלום one! *מבצע חדש* על המוצרים שבחרת.\nבדקוone מחיר, דברו איתנו, או בחרו אפשרות מהירה."
},
{
"unique": "5ec46920d615hh3-x3c15a2dff350a1-3SIZZq8h9JVdA53",
"to": "972509876541",
"body": "שלום two! *מבצע חדש* על המוצרים שבחרת.\nבדקוtwo מחיר, דברו איתנו, או בחרו twoאפשרות מהירה."
}
],
"reason": 1
}
Response-Explain:
Parameter | Description | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | OK or FAIL **Note: OK status doesn't mean the messages arrived to the end user. it only means that the system received your request. You should listen to webhooks to see the status of your message. | ||||||||||||||||||||||||||||||||||||||
from | your WhatsApp account | ||||||||||||||||||||||||||||||||||||||
accepted | How many destinations the request was procesed successfully. int. | ||||||||||||||||||||||||||||||||||||||
rejected | How many destinations the request was rejected (wrong number, wrong to, wrong variables). fix and try again. int. | ||||||||||||||||||||||||||||||||||||||
failed | How many destination the request was failed (system error, WhatApp error) try again. int. | ||||||||||||||||||||||||||||||||||||||
timestamp | Timestamp of the sending | ||||||||||||||||||||||||||||||||||||||
destinations | array that contains 3 keys unique - the unique message of the sending to - the number that the message was sent to body - the BODY of the template, including the variables | ||||||||||||||||||||||||||||||||||||||
originalRequest | original request object, if you enabled this in 'showRequest' when sending the request. | ||||||||||||||||||||||||||||||||||||||
reason | 'reason' is the status explanation in case of FAIL
|