Skip to main content

Categories API

Manage blog categories. All endpoints require authentication.

Category object

FieldTypeDescription
category_idIntUnique category identifier (read-only)
nameStringCategory name
statusBooleantrue = enabled, false = disabled
parent_idIntID of the parent category (0 for root)
url_keyStringURL slug
contentStringCategory description (HTML supported)
sort_orderIntDisplay order within the parent
is_anchorBooleanWhen enabled, shows posts from child categories on this category's page
pathStringFull path of category IDs (read-only)
levelIntDepth in the category tree (read-only)
children_countIntNumber of direct child categories (read-only)
store_idsInt[]Store view IDs this category is visible on
meta_titleStringSEO meta title
meta_descriptionStringSEO meta description
robotsStringRobots directive (e.g. INDEX,FOLLOW)
created_atStringCreation timestamp (read-only)
updated_atStringLast update timestamp (read-only)

Get category

GET /rest/V1/blog/category/:categoryId

Response:

{
"category_id": 3,
"name": "Tutorials",
"status": true,
"parent_id": 1,
"url_key": "tutorials",
"content": "<p>Step-by-step guides.</p>",
"sort_order": 10,
"is_anchor": false,
"path": "1/3",
"level": 1,
"children_count": 2,
"store_ids": [1],
"meta_title": "Tutorials",
"meta_description": "Step-by-step guides for Magento 2.",
"created_at": "2024-01-10 08:00:00",
"updated_at": "2024-02-05 12:00:00"
}

Errors: 404 category not found.

List categories

GET /rest/V1/blog/categories

Supports filtering and pagination.

Response:

{
"items": [ { ... }, { ... } ],
"search_criteria": { "filter_groups": [], "page_size": 20, "current_page": 1 },
"total_count": 8
}

Create category

POST /rest/V1/blog/category

Request body:

{
"category": {
"name": "News",
"status": true,
"parent_id": 1,
"url_key": "news",
"store_ids": [1]
}
}

name, url_key, and store_ids are required. All other fields are optional.

Response: the created category object with category_id assigned.

Update category

PUT /rest/V1/blog/category/:categoryId

Request body: same structure as Create category. Include only the fields you want to change.

Response: the updated category object.

Errors: 404 category not found.

Delete category

DELETE /rest/V1/blog/category/:categoryId

Response:

true

Errors: 404 category not found.