Skip to main content
The Admin Categories API lets you build and maintain the taxonomy that organizes your product catalog. Use it to create categories, control their visibility with the is_active flag, assign products to categories, and soft-delete categories when they are no longer needed. Unlike the public catalog endpoint, the admin view surfaces inactive and optionally deleted categories so you have full visibility into every state.
All category endpoints require an authenticated session with the ADMIN or SUPER_ADMIN role. Fetch a CSRF token from GET /auth/csrf-token and pass it in the x-csrf-token header for every POST, PATCH, PUT, and DELETE request.

List Categories

Retrieve a paginated list of categories from the admin view. Unlike the public endpoint, inactive and soft-deleted categories are visible here depending on the filter flags you provide.

Query Parameters

integer
default:"1"
Page number (1-based).
integer
default:"20"
Items per page. Accepted range: 1–100.
Free-text search across category name and description.
string
default:"name"
Sort field. Prefix with - for descending. Accepted values: name, -name, created_at, -created_at, updated_at, -updated_at.
string
Filter by active status. Pass "true" to return only active categories, "false" for inactive only. Omit to return all.
string
default:"false"
Pass "true" to include soft-deleted categories. Must be the string "true" or "false".

Response

array
Array of category objects.
object

Create Category

Create a new product category. Only name is required. The API auto-generates a URL slug from the name if you do not supply one.

Request Body

string
required
Category display name. Between 1 and 255 characters.
string
URL-safe slug. Must match ^[a-z0-9]+(?:-[a-z0-9]+)*$ and be unique. Auto-generated from name if omitted. Maximum 255 characters.
string
Long-form category description. Maximum 10,000 characters. Optional.
boolean
default:"true"
Whether the category is immediately visible to customers. Defaults to true.
When you omit slug, the API derives it from the name by lowercasing, replacing spaces with hyphens, and stripping unsupported characters. For example, "Running Shoes" becomes "running-shoes". If the auto-generated slug conflicts with an existing one, the API appends a short unique suffix automatically. Provide an explicit slug when you need deterministic URLs.

Example

201 Response

Error Responses


Get Category

Fetch the full admin projection of a single category by its public ID. The admin view returns the category regardless of is_active or soft-deletion state.

Path Parameters

string
required
The category’s public ID, prefixed cat_.
Returns the full category object. Responds with 404 if the category does not exist.

Update Category

Partially update a category’s fields. Only the fields you supply are changed. Pass null for description to explicitly clear it.

Path Parameters

string
required
The category’s public ID, prefixed cat_.

Request Body

At least one field is required.
string
Updated display name. Between 1 and 255 characters.
string
Updated URL slug. Must match ^[a-z0-9]+(?:-[a-z0-9]+)*$. Returns 409 on conflict.
string | null
Updated description. Pass null to clear the existing value.
boolean
Toggle customer visibility without deleting the category.
Use is_active: false to temporarily hide a category from customers — for example, while you reorganize its products or prepare a seasonal launch — without soft-deleting it. Toggle it back to true when you are ready to go live. This is much easier to reverse than a delete operation.

Example


Delete Category

Soft-delete a category. The category is immediately hidden from all customer-facing endpoints but retained in the database for referential integrity. Returns 204 No Content on success.

Path Parameters

string
required
The category’s public ID, prefixed cat_.

Example

Error Responses


Assign Product to Category

Assign a single product to a category. The operation is idempotent — assigning a product that is already in the category returns 204 without error.

Path Parameters

string
required
The category’s public ID, prefixed cat_.
string
required
The product’s public ID, prefixed prd_.

Example

Response

Returns 204 No Content on success. Returns 404 if the category or product does not exist.

Remove Product from Category

Unassign a single product from a category. The operation succeeds with 204 even if the product was not assigned to the category. Returns 404 if the category or product does not exist.

Path Parameters

string
required
The category’s public ID, prefixed cat_.
string
required
The product’s public ID, prefixed prd_.

Example

Error Responses