Delete Object (DELETE)

Overview

The DELETE method allows you to permanently remove objects from the system. This operation cannot be undone, so use it with caution.

Important: Only URLs referring to specific object IDs can be used with the DELETE method. Bulk deletion operations are not supported.

HTTP Method

To delete an object, send a DELETE HTTP request to the URL that refers to the specific object you want to remove.

DELETE /api/{resource_type}/{resource_id}

Request Example

This example demonstrates how to delete a product with ID 12:

curl --user admin@example.com:APIkey -X DELETE 'https://www.venddor.com.br/api/products/12'

Response

When an object is successfully deleted, the server will respond with:

Status Code Description
204 No Content The object has been deleted successfully. No body is returned.
Note: If the object cannot be deleted (e.g., due to dependencies or permissions), you will receive an appropriate error code and message.

Common Error Responses

Status Code Description
400 Bad Request The object could not be deleted due to validation errors or dependencies.
401 Unauthorized Authentication credentials were missing or invalid.
403 Forbidden The authenticated user does not have permission to delete the object.
404 Not Found The specified object does not exist.