Posts API
Manage blog posts. All endpoints require authentication.
Post object
| Field | Type | Description |
|---|---|---|
post_id | Int | Unique post identifier (read-only) |
name | String | Post title |
status | Int | 0 = Draft, 1 = Pending Review, 2 = Published, 3 = By Direct Link |
author_id | Int | ID of the associated author |
short_content | String | Excerpt / teaser text |
content | String | Full post body (HTML supported) |
url_key | String | URL slug |
featured_image | String | Path to the featured image |
featured_alt | String | Alt text for the featured image |
featured_show_on_home | Boolean | Display this post in the featured block on the homepage |
is_pinned | Boolean | Pin post to the top of listings |
category_ids | Int[] | IDs of associated categories |
tag_ids | Int[] | IDs of associated tags |
product_ids | Int[] | IDs of related products |
related_post_ids | Int[] | IDs of related posts |
store_ids | Int[] | Store view IDs this post is visible on |
meta_title | String | SEO meta title |
meta_keywords | String | SEO meta keywords |
meta_description | String | SEO meta description |
robots | String | Robots directive (e.g. INDEX,FOLLOW) |
view_count | Int | Number of views (read-only) |
created_at | String | Creation timestamp (read-only) |
updated_at | String | Last update timestamp (read-only) |
modified_at | String | Last 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.