Skip to main content

Posts API

Manage blog posts. All endpoints require authentication.

Post object

FieldTypeDescription
post_idIntUnique post identifier (read-only)
nameStringPost title
statusInt0 = Draft, 1 = Pending Review, 2 = Published, 3 = By Direct Link
author_idIntID of the associated author
short_contentStringExcerpt / teaser text
contentStringFull post body (HTML supported)
url_keyStringURL slug
featured_imageStringPath to the featured image
featured_altStringAlt text for the featured image
featured_show_on_homeBooleanDisplay this post in the featured block on the homepage
is_pinnedBooleanPin post to the top of listings
category_idsInt[]IDs of associated categories
tag_idsInt[]IDs of associated tags
product_idsInt[]IDs of related products
related_post_idsInt[]IDs of related posts
store_idsInt[]Store view IDs this post is visible on
meta_titleStringSEO meta title
meta_keywordsStringSEO meta keywords
meta_descriptionStringSEO meta description
robotsStringRobots directive (e.g. INDEX,FOLLOW)
view_countIntNumber of views (read-only)
created_atStringCreation timestamp (read-only)
updated_atStringLast update timestamp (read-only)
modified_atStringLast content modification timestamp (read-only)

Get post

GET /rest/V1/blog/post/:postId

Response:

{
"post_id": 5,
"name": "Getting Started with Magento 2",
"status": 2,
"author_id": 1,
"short_content": "A quick overview of Magento 2 basics.",
"content": "<p>Full post body...</p>",
"url_key": "getting-started-magento-2",
"featured_image": "blog/post/image.jpg",
"featured_alt": "Magento 2 screenshot",
"is_pinned": false,
"category_ids": [3, 7],
"tag_ids": [12],
"product_ids": [],
"related_post_ids": [4, 6],
"store_ids": [1],
"meta_title": "Getting Started with Magento 2",
"meta_description": "Learn the basics of Magento 2.",
"view_count": 128,
"created_at": "2024-01-15 10:00:00",
"updated_at": "2024-03-20 14:32:00"
}

Errors: 404 post not found.

List posts

GET /rest/V1/blog/posts

Supports filtering and pagination.

Response:

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

Create post

POST /rest/V1/blog/post

Request body:

{
"post": {
"name": "New Blog Post",
"status": 0,
"content": "<p>Post content here.</p>",
"short_content": "Brief excerpt.",
"url_key": "new-blog-post",
"author_id": 1,
"category_ids": [3],
"tag_ids": [12],
"store_ids": [1]
}
}

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

Response: the created post object with post_id assigned.

Update post

PUT /rest/V1/blog/post/:postId

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

Response: the updated post object.

Errors: 404 post not found.

Delete post

DELETE /rest/V1/blog/post/:postId

Response:

true

Errors: 404 post not found.