Skip to main content

Content Templates

Content templates are reusable content structures that can be used as starting points when creating new blog posts or pages. They store predefined content, metadata, and configuration as JSON.

Endpoints

MethodPathPermissionDescription
GET/sites/{site_id}/content-templates?page&per_page&searchReadList templates (paginated, searchable)
GET/content-templates/{id}ReadGet a template by ID
POST/sites/{site_id}/content-templatesAuthorCreate a template
PUT/content-templates/{id}AuthorUpdate a template
DELETE/content-templates/{id}EditorDelete a template

List Templates

Supports search by name or description:

curl -H "X-API-Key: oy_live_abc123..." \
"https://your-domain.com/api/v1/sites/{site_id}/content-templates?search=blog&page=1&per_page=10"

Create a Template

Template names must be unique within a site. Duplicates return 409 Conflict.

curl -X POST \
-H "X-API-Key: oy_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "Standard Blog Post",
"description": "Template for a standard blog post with intro and body",
"content_type": "blog",
"template_data": {
"sections": ["intro", "body", "conclusion"],
"default_status": "Draft"
}
}' \
https://your-domain.com/api/v1/sites/{site_id}/content-templates

Response 201 Created

{
"id": "template-uuid",
"site_id": "site-uuid",
"name": "Standard Blog Post",
"description": "Template for a standard blog post with intro and body",
"content_type": "blog",
"template_data": { "..." },
"created_at": "2025-01-15T12:00:00Z",
"updated_at": "2025-01-15T12:00:00Z"
}