GET/categories/{id}
Get category by ID
Retrieve a single category. Supports ETag conditional requests via `If-None-Match`.
Parameters 4
| Name | Type | Description |
|---|---|---|
_fields | query · string | Sparse fieldset — comma-separated fields to return. Leave blank for the full object. |
_expand | query · string | Expand parent relations inline. Applies only when the resource has a matching parent (e.g. `user` on posts). |
_embed | query · string | Embed child collections. Applies only when the resource has a matching child (e.g. `comments` on posts). |
ReturnsCategory
Bearer token required
Response examples
200The category
{
"id": 1,
"name": "Electronics",
"slug": "electronics",
"description": "Gadgets, devices, and electronic accessories",
"image": "https://picsum.photos/seed/cat1/300/200",
"productCount": 5,
"createdAt": "2022-01-06T04:19:58.076Z"
}404404 — resource not found
{
"error": {
"status": 404,
"message": "users #999 not found"
}
}