Skip to main content
DELETE
Deleting an instance

Overview

Method used to delete an instance linked to your account. To delete several at once, use Deleting instances in bulk.
To use Partner endpoints, provide the Partner Token in the Authorization field using the following format: Bearer <Partner-Token>It is not necessary to send the Client-Token in these requests.
Deletion is permanent and cannot be undone.

Eligibility rules

An instance is only deleted when it meets all of the conditions below:
  • It is disconnected from WhatsApp and from the phone.
  • Its payment status is pending, trial, or canceled. Paid instances, ones with a pending bank slip, ones in the cancellation process, ones in payment retry, or ones without a defined payment status are not eligible.
  • If it is pending, it has no pending subscription. Cancel the subscription before deleting the instance.
Canceled instances can be deleted as soon as they enter that status, with no grace period after cancellation.

Attributes

string
required
Partner token in the Bearer <Partner-Token> format

Path

string
required
Your instance ID. Available in the Z-API panel under Instances.
string
required
Your Z-API instance token.

Response

204

The instance was deleted. The response has no body.

403

The instance does not meet the eligibility rules. The type field identifies the rule that blocked the deletion and the message field describes the reason.
Possible reasons:

401

The Authorization header was not sent or the Partner Token is invalid.

404

No instance exists for the given instanceId and token pair.

405

Make sure you are correctly sending the method specification, that is, verify that you sent DELETE as specified at the beginning of this topic.

415

If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.