Admin API
Categories
Category tree — flat or nested.
Categories group products for storefront navigation. They can nest one level (parent / child); deeper trees aren't supported in v1.
Category object
{
"id": "c1d2e3f4-...",
"name": "Sarees",
"slug": "sarees",
"description": "Cotton and silk sarees.",
"imageUrl": "https://r2.sellvik.com/categories/sarees.jpg",
"parentId": null,
"isFeatured": true,
"sortOrder": 1,
"productCount": 47,
"createdAt": "2026-05-15T10:00:00.000Z"
}List categories
GET /api/v1/admin/categoriesScope: categories:read
Query parameters
| Name | Type | Notes |
|---|---|---|
limit | integer (1–100) | Default 50 — categories are small. |
cursor | string | Opaque cursor. |
q | string | Substring match on name. |
Create a category
POST /api/v1/admin/categoriesScope: categories:write
Request body
{
"name": "Sarees",
"slug": "sarees",
"description": "Cotton and silk sarees.",
"imageUrl": "https://r2.sellvik.com/categories/sarees.jpg",
"parentId": null,
"isFeatured": true,
"sortOrder": 1
}| Field | Required | Notes |
|---|---|---|
name | yes | 1–80 chars. |
slug | no | Auto-derived from name if omitted. |
parentId | no | UUID of parent category (top-level if omitted/null). |
sortOrder | no | Lower numbers appear first. Default 100. |
Errors
| Status | Code | When |
|---|---|---|
| 409 | duplicate_slug | Slug already exists in this shop. |
| 400 | invalid_parent | parentId points to a non-root category. |
Get a category
GET /api/v1/admin/categories/{id}Scope: categories:read
Update a category
PATCH /api/v1/admin/categories/{id}Scope: categories:write
Example
curl -X PATCH "https://api.sellvik.app/api/v1/admin/categories/c1d2..." \
-H "Authorization: Bearer <admin-key>" \
-H "Content-Type: application/json" \
-d '{ "isFeatured": false }'Delete a category
DELETE /api/v1/admin/categories/{id}Scope: categories:write
Response
204 on success.
Errors
| Status | Code | When |
|---|---|---|
| 409 | has_subcategories | Category still has children. Delete those first. |
Hard-delete: products linked to the category are not deleted; they become
uncategorised. Re-link them through PATCH /v1/admin/products/{id} with a
new categoryIds array.