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

  1. 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.
  2. To set up a WhatsApp account on Kaleyra platform, see Manual Signup
    and Embedded Signup.
  3. 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.

Base URL

https://<api_domain>/v2/<SID>

API Domain and Value

api_domainValue
IN podapi.in.kaleyra.io
SG Podapi.ap.kaleyra.io
EU Podapi.eu.kaleyra.io
NA podapi.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:

Request Format

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>"
				}'

Sample Request Format

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 / HeadersData TypeDescriptionExampleMandatory?
sidStringAccount SID (Security Identifier).HXAP16XXXXXX97INYes
waba_idStringWhatsApp Business Account. For more information see, Adding a new WABA ID.150XXXXXX142241Yes
api-keyStringAPI key generated from Kaleyra platform account.Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3Yes

The following is the list of attributes to be used in the payload to delete the WhatsApp message templates:

Parameter / HeadersData TypeDescriptionExampleMandatory?
start_dateDateThe start date from which you wish to delete the message templates.2025-08-01Optional
end_dateDateThe end date till which you wish to delete the message templates.2025-08-04Optional
nameStringName 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_1Optional
template_idStringThe unique WhatsApp template ID based on which the templates need to be deleted.112xxxxxxxx566, 112xxxxxxxxxx661Optional
statusStringThe status of the WhatsApp message templates to be deleted.REJECTED, PAUSEDOptional
languageStringThe language in which the templates were created. The default is English.en_USOptional

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





© 2025 Kaleyra Inc. All rights reserved.
Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.