Get Children Categories
Lists the direct children of a category, newest first. Use it to walk the tree one level at a time from the root. A category id that matches nothing answers an empty page, not an error.
Required permission: category:view
Request
GET /v2/admin/categories/{category_id}/children
Parameters
| Name | Type | In | Description |
|---|---|---|---|
category_id | string | path | Required. Id of the parent category (24-character hex) |
page | integer | query | Required. Page number, starting at 1 |
per_page | integer | query | Required. Items per page, 1–100 |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Example
curl --request GET \
--url '{{baseUrl}}/v2/admin/categories/667e9251ca818a2138ed4891/children?page=1&per_page=20' \
--header 'Authorization: Bearer <access_token>'
Response
{
"data": [
{
"id": "667e9251ca818a2138ed4915",
"parent_id": "667e9251ca818a2138ed4891",
"name": {
"en": "Residential",
"tr": "Konut"
},
"path": "1.2.7.25",
"int_id": 25,
"image_svg": null,
"image_url": null,
"is_leaf": true,
"show_on_dashboard": false,
"created_at": "2023-09-05T19:26:16.294Z"
}
],
"total": 1,
"page": 1,
"per_page": 20
}
Response Fields
| Field | Type | Description |
|---|---|---|
data | array | Child categories on this page. Each item has the shape described on Get Category |
total | integer | Number of direct children |
page | integer | Page number sent in the request |
per_page | integer | Page size sent in the request |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation failed (page / per_page missing or out of range) — see details |
| 400 | 10016 | category_id is not a valid 24-character hex id |
See Errors for the error format and common codes.