Introduction
The Posts API provides comprehensive endpoints for managing blog posts in the Blog Marketing Platform. This includes CRUD operations, statistics tracking, engagement metrics, and advanced content management features.Base Endpoint
Authentication
All Posts API endpoints require authentication. Include the user’s authentication token in the request headers:Post Object Structure
Unique identifier for the post
Post title
URL-friendly version of the title
Full post content in HTML or Markdown
Short summary of the post
Post status:
draft, published, pending, or rejectedID of the post author
Author details object
Backend state ID (maps to status)
URL to the post’s featured image
ISO 8601 timestamp of publication
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
Estimated reading time in minutes
Total view count
Total like count
Total comment count
Total share count
Whether the post is featured
Whether comments are enabled
Whether the post is pinned to the top
Array of category objects
Array of keyword objects
Array of tag strings
SEO metadata
Status Values
Posts can have one of four status values:| Status | Estado ID | Description |
|---|---|---|
draft | 1 | Post is being edited and not visible to public |
pending | 2 | Post is awaiting review/approval |
published | 3 | Post is live and visible to public |
rejected | 4 | Post was rejected during review |
Common Patterns
Creating a Post
When creating a post, onlytitle and content are required. The system will:
- Auto-generate a slug from the title if not provided
- Set status to
draftby default - Auto-calculate reading time based on word count
- Set the current user as the author
Updating Posts
Partial updates are supported - only include fields you want to change. TheupdatedAt timestamp is automatically updated.
Status Transitions
Typical workflow:- Create as
draft - Edit and refine content
- Change to
pendingfor review - Reviewer changes to
publishedorrejected
Slug Generation
Slugs are automatically generated using postsService.ts:211-221:- Converted to lowercase
- Accents removed
- Special characters removed
- Spaces replaced with hyphens
- Limited to 255 characters
Error Handling
All endpoints return standard HTTP status codes:200- Success201- Created successfully400- Bad request (invalid data)401- Unauthorized (missing/invalid token)404- Post not found500- Server error
Rate Limiting
API requests are rate limited to prevent abuse. Current limits:- 100 requests per minute per user
- 1000 requests per hour per user
Pagination
List endpoints support pagination via query parameters:Number of results to return (max 100)
Number of results to skip
Page number (alternative to offset)
Next Steps
CRUD Operations
Learn about creating, reading, updating, and deleting posts
Statistics
Track post performance and analytics
Interactions
Manage likes, views, and keywords
Categories
Organize posts with categories