Get All Posts
Retrieve a list of all posts.Response
Returns an array of Post objects.Get Post by ID
Retrieve a single post by its ID.Parameters
The unique identifier of the post
Response
Returns a Post object ornull if not found.
Get Complete Posts
Retrieve posts with all relations (categories, keywords, author details).Parameters
Maximum number of posts to return
Response
Returns an array of Post objects with all related data populated.Create Post
Create a new blog post.Request Body
Post title (required)
Post content (HTML or Markdown)
Custom URL slug (auto-generated from title if not provided)
Short description of the post
Initial status:
draft, published, pending, or rejectedPrimary category ID
Array of tag strings (will be converted to keywords)
URL to featured image
Mark as featured post
Enable comments on this post
Pin post to top of listings
SEO metadata object
Response
Returns the created Post object with generated ID and timestamps.Update Post
Update an existing post. Partial updates are supported.Parameters
ID of the post to update
Object containing fields to update (only include fields you want to change)
Response
Returns the updated Post object ornull if not found.
Update Post Status
Change the status of a post.Parameters
ID of the post to update
New status:
draft, published, pending, or rejectedResponse
Returns the updated Post object with new status.Delete Post
Permanently delete a post.Parameters
ID of the post to delete
Response
Returnstrue if deletion was successful, false otherwise.
Bulk Actions
Perform actions on multiple posts at once.Parameters
Array of post IDs to perform action on
Action to perform:
publish, draft, or deleteActions
publish- Changes status topublisheddraft- Changes status todraftdelete- Permanently deletes the posts
Upload Featured Image
Upload and set a featured image for a post.Parameters
ID of the post
Image file to upload (JPEG, PNG, WebP supported)
Response
URL of the uploaded image
Helper Functions
Get Pending Posts
Get all posts awaiting review.pending. Useful for review queues and notifications.
This function works with the local store in mock mode. In production, use
getAllPosts() and filter by status.