Skip to content

DeleteCollection#

Test Postman Apidog

To use this method, you must have a WhatsApp Business account.

The method is designed to delete a collection from the catalog.

Irreversibility of deletion

Deleting a collection cannot be undone. After deletion, the collection's identifier becomes invalid, but the products from the collection remain in the catalog (the collection itself is removed).

WhatsApp-side limitations

If catalog methods are called frequently, WhatsApp may temporarily restrict access to the Business Catalog API. Do not send a large number of requests to catalog methods over a short period of time.

Request#

To delete a collection, you need to send a request to the address:

POST
{{apiUrl}}/waInstance{{idInstance}}/deleteCollection/{{apiTokenInstance}}

To obtain the request parameters idInstance and apiTokenInstance, refer to the section Before you start.

Request parameters#

Parameter Type Required Description
collectionId string Yes Unique identifier of the collection to be deleted

Request body example#

{
  "collectionId": "984885117332518"
}

Response#

Response fields#

Field Type Description
deleted boolean Returns true if the deletion was successful
deletedCollectionId string Identifier of the deleted collection

Response body example#

{
  "deleted": true,
  "deletedCollectionId": "984885117332518"
}

DeleteCollection errors#

For a list of common errors for all methods, see the section Common errors

HTTP code Error identifier Description
400 Catalog mutations require a business account WhatsApp-side restriction that occurs when catalog methods are called frequently. Returned even when the request is made from a Business account

Code examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/deleteCollection/{{apiTokenInstance}}"

payload = {
    "collectionId": "984885117332518"
}
headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, json=payload, headers=headers)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/deleteCollection/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "collectionId": "984885117332518"
}'