Content Management
Content management APIs allow you to create, read, update, and delete content entries for your schemas. This document outlines all available content management endpoints.
Authentication
All content management endpoints require Editor role or above.
List Content
Retrieve a paginated list of content entries for a specific schema.
Query Parameters
page
: Page number (default: 1)page_size
: Items per page (default: 10, max: 100)order_by
: Sort field (created_at
,updated_at
,slug
)order
: Sort direction (asc
ordesc
)search
: Search in slug and contentstatus
: Filter by status (published
ordraft
)
Response Format
{
"data": [
{
"id": "uuid",
"slug": "content-slug",
"content_type_id": "schema-uuid",
"data": {},
"is_published": false,
"published_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"current_version": 1,
"status": "draft"
}
],
"pagination": {
"current_page": 1,
"page_size": 10,
"total_pages": 5,
"total": 50
},
"query": {
"order_by": "created_at",
"order": "desc",
"search": "",
"status": ""
}
}
Get Content by ID
Retrieve a specific content entry by its ID.
Create Content
Create a new content entry for a schema.
Request Body
slug
(required): URL-friendly identifier- Must be lowercase
- No spaces
- No underscores
- Unique within schema
data
(required): Content data matching schema fields- Must match exactly with the schema field definitions
- All required fields must be provided
- Field types must match schema specifications
Update Content
Update an existing content entry.
Request Body
slug
(required): URL-friendly identifier- Must be lowercase
- No spaces
- No underscores
- Unique within schema
data
(required): Content data matching schema fields
Update Content
Update an existing content entry.
Delete Content
Delete a content entry.
Content Versioning
List Versions
Get all versions of a content entry.
Get Specific Version
Get a specific version of a content entry.
Create Version
Create a new version of a content entry.
Restore Version
Restore a previous version of content.
Publishing
Publish Content
Publish a content entry.
Unpublish Content
Unpublish a content entry.
Field Validation
The system validates content data based on field types:
-
Text Fields
- Validates string type
- Checks min/max length
-
Number Fields
- Validates numeric type
- Checks min/max values
-
Date/DateTime Fields
- Validates date format
- Date: YYYY-MM-DD
- DateTime: ISO 8601
-
Email Fields
- Validates email format
-
Boolean Fields
- Validates true/false values
-
Select Fields
- Validates against allowed options
Error Responses
400 Bad Request
- Invalid input data
- Validation errors
- Duplicate slug
{
"error": "Error message"
}
404 Not Found
- Schema not found
- Content not found
- Version not found
{
"error": "Resource not found"
}
403 Forbidden
- Insufficient permissions
{
"error": "Access denied"
}
Best Practices
- Use meaningful slugs for better SEO
- Implement proper version control
- Validate content before publishing
- Use appropriate field types
- Keep content structure consistent
- Regular content backups
- Monitor content status