Delete Message Templates in Bulk
DELETE Method
The Delete Message Templates in Bulk API allows you to delete the WhatsApp message templates in bulk (both approved and pending message templates). After the successful deletion, the templates get deleted from both Meta and the Kaleyra platforms.
You can delete the WhatsApp message templates in bulk using the following:
Delete by name
Deletes all templates that match the provided name (templates with the same name but with different languages get deleted). Multiple templates can be deleted by passing comma separated templates name.
Delete by IDs
Deletes all templates that match the provided IDs. Multiple templates can be deleted by passing comma separated template IDs.
Delete by date interval
Deletes all templates that were created within that date range. To delete the templates based on a date range, the start date and end date must be provided.
Delete by status
Deletes all templates that match the status. Multiple templates can be deleted by passing comma separated value of statuses. For example, PENDING, REJECTED.
Delete by language
Deletes all templates that match the language of the templates. Multiple templates can be deleted by passing comma separated value of the language. For example, en, en_US.
Delete with multiple parameters
You can pass multiple parameters. Templates get deleted when all conditions are met. For example, you can pass start_data, end_date, status, language, and other parameters. The templates that match all the conditions get deleted.
Prerequisites
- Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on Kaleyra platform. - To set up a WhatsApp account on Kaleyra platform, see Manual Signup
and Embedded Signup. - An active WhatsApp for Business API plan that includes:
- A WhatsApp business number.
- An associated profile with the business number.
- A WhatsApp verified and approved profile.
- A WABA ID onboarded on Kaleyra WhatsApp API V2.
API Domain and Value
api_domain | Value |
---|---|
IN pod | api.in.kaleyra.io |
SG Pod | api.ap.kaleyra.io |
EU Pod | api.eu.kaleyra.io |
NA pod | api.na.kaleyra.ai |
API request to delete the WhatsApp message templates in bulk
To delete the WhatsApp message templates in bulk, use the https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/message_templates_bulk
endpoint with the following request method:
The following is the request format to delete WhatsApp message templates in bulk:
curl -L -X DELETE \
https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/message_templates_bulk \
-H 'api-key: <api-key>' \
-H 'cache-control: no-cache' \
-D '{
"start_date": "<start_date>",
"end_date": "<end_date>",
"name": "<name>",
"template_id": "<template_id>",
"status": "<status>",
"language": "<language>"
}'
The following is the sample request format to delete WhatsApp message templates in bulk:
curl -L -X DELETE \
https://api.in.kaleyra.io/v2/HXAP16XXXXXX97IN/whatsapp/150XXXXXX142241/message_templates_bulk \
-H 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
-H 'cache-control: no-cache' \
-D '{
"start_date": "2025-08-01",
"end_date": "2025-08-04",
"name": "Promo_Offer, Promo_Offer_1",
"template_id": "112xxxxxxxx566, 112xxxxxxxxxx661",
"status": "REJECTED, PAUSED",
"language": "en_US"
}
URL Parameters and Headers
The following is the list of parameters and headers to send the outgoing message request:
Parameter / Headers | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
sid | String | Account SID (Security Identifier). | HXAP16XXXXXX97IN | Yes |
waba_id | String | WhatsApp Business Account. For more information see, Adding a new WABA ID. | 150XXXXXX142241 | Yes |
api-key | String | API key generated from Kaleyra platform account. | Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3 | Yes |
The following is the list of attributes to be used in the payload to delete the WhatsApp message templates:
Parameter / Headers | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
start_date | Date | The start date from which you wish to delete the message templates. | 2025-08-01 | Optional |
end_date | Date | The end date till which you wish to delete the message templates. | 2025-08-04 | Optional |
name | String | Name of the existing WhatsApp message templates need to be deleted. Multiple templates can be deleted by passing comma separated template name. | Promo_Offer, Promo_Offer_1 | Optional |
template_id | String | The unique WhatsApp template ID based on which the templates need to be deleted. | 112xxxxxxxx566, 112xxxxxxxxxx661 | Optional |
status | String | The status of the WhatsApp message templates to be deleted. | REJECTED, PAUSED | Optional |
language | String | The language in which the templates were created. The default is English. | en_US | Optional |
Sample Success Response
The following success message appears with the status 200 Accepted:
{
"code": "WA200",
"message": "Request Processed Successfully",
"data": "No of rows affected: 2",
"error": {}
}
Sample Failure Response
The following are the failure responses:
401 Unauthorized
{
"code": "RBC001",
"message": "Incorrect SID or API key.",
"data": [],
"error": {
"error": "Incorrect SID or API key."
}
}
401 Wrong account
{
"code": "WA-401",
"message": "API is not available for given customer.Please contact support for more info",
"data": {},
"error": "API is not available for given customer.Please contact support for more info"
}
401 Unauthorized WABA
{
"code": "WA401",
"message": "Waba_Id is not present or does not belong to the account.",
"data": {},
"error": {
"waba_id": "Waba_Id is not present or does not belong to the account."
}
}
401 Unauthorized WABA version
{
"code": "WA401",
"message": "The waba_id you're using is associated with different Version of our WA API. Please use the appropriate endpoint.",
"data": {},
"error": {
"waba_id": "The waba_id you're using is associated with different Version of our WA API. Please use the appropriate endpoint."
}
}
400 Incorrect payload
{
"code": "WA-400",
"message": "Refer to correct payload format",
"data": {},
"error": {
"payload": "Incorrect payload format"
}
}
500 Internal Server Error
{
"code": "WA-500",
"message": "Please try again later",
"data": {},
"error": {
"error": "Internal server error"
}
}
429 Too many requests
{
"code": "WA429",
"message": "Too many requests",
"data": {},
"error": {
"error": "Too many requests sent from this waba in a short period of time, please try after sometime"
}
}
Meta Error
{
"code": "WA400",
"message": "error returned from meta",
"data": {},
"error": {
"code": 100,
"error_subcode": 2593048,
"error_user_msg": "Make sure that the HSM name and ID match.",
"error_user_title": "Name and ID do not match",
"fbtrace_id": "AI4yYl-mIsrlsb7rmO3HY0R",
"is_transient": false,
"message": "Invalid parameter",
"type": "OAuthException"
}
}
Updated about 11 hours ago