Skip to main content

Delete Category

Soft-deletes a category: it disappears from every read. Only a childless, non-root category can be deleted.

  • A category with children is refused: deleting it would orphan them, because their path would point at a deleted ancestor. Delete the subtree bottom-up first.
  • The root category (int_id 1) cannot be deleted.
  • The parent's is_leaf is left as it is: emptying a branch does not turn it into a leaf.

A second delete of the same category answers "category not found".

Required permission: category:delete

Request​

DELETE /v2/admin/categories/{category_id}

Parameters​

NameTypeInDescription
category_idstringpathRequired. Category id (24-character hex)

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>

Example​

curl --request DELETE \
--url '{{baseUrl}}/v2/admin/categories/6911a3c2e4b0f51d2c8a7e41' \
--header 'Authorization: Bearer <access_token>'

Response​

204 No Content with an empty body.

Errors​

StatusCodeDescription
40010016category_id is not a valid 24-character hex id
40010001Category not found or already deleted (domain 4)
40010004The category has children and cannot be deleted (domain 4)
40010005The root category cannot be deleted (domain 4)

See Errors for the error format and common codes.