Skip to main content
DELETE
/
categories
/
:id
curl -X DELETE https://api.example.com/categories/1 \
  -H "Authorization: Bearer YOUR_TOKEN"
No Content
This endpoint deletes an existing category by ID. Requires authentication and admin role.

Authentication

Authorization
string
required
Bearer token for authentication. Must have admin role.

Path Parameters

id
string
required
The unique identifier of the category to delete
curl -X DELETE https://api.example.com/categories/1 \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

Returns a 204 No Content status code on successful deletion with no response body.
No Content

Error Responses

{
  "message": "Unauthorized"
}

Notes

  • Deleting a category may fail if there are products associated with it, depending on your database constraints
  • This operation is irreversible
  • Consider using a soft delete approach in production environments

Build docs developers (and LLMs) love