Skip to main content
DELETE
/
categories
/
:id
curl --request DELETE \
  --url https://api.example.com/categories/1 \
  --header 'Authorization: Bearer <token>'
{
  "id": 1,
  "name": "Teas",
  "slug": "teas",
  "isActive": true,
  "createdAt": "2024-03-10T12:00:00.000Z"
}
Deletes a category from the system.
This endpoint requires authentication with an ADMIN role.
Deleting a category may fail if there are products associated with it due to foreign key constraints.

Authentication

Requires a valid JWT token in the Authorization header:
Authorization: Bearer <token>

Path Parameters

id
number
required
Category ID (must be numeric)

Response

data
Category
The deleted category object
curl --request DELETE \
  --url https://api.example.com/categories/1 \
  --header 'Authorization: Bearer <token>'
{
  "id": 1,
  "name": "Teas",
  "slug": "teas",
  "isActive": true,
  "createdAt": "2024-03-10T12:00:00.000Z"
}

Build docs developers (and LLMs) love