Content
CRUD operations for site content, scoped to the authenticated user's site.
Retrieves content items for the authenticated user's site with pagination, sorting, and filtering.
Query Parameters
Page number
1 <= value1Items per page
1 <= value <= 10020Sort field
"updated_at"Value in
- "created_at"
- "updated_at"
- "published_at"
- "title"
Filter by status
Value in
- "draft"
- "published"
Filter by content type
Value in
- "post"
- "page"
Response Body
application/json
application/json
curl -X GET "https://example.com/api/content"{ "data": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1", "authorId": "string", "title": "string", "slug": "string", "body": {}, "status": "draft", "contentType": "post", "excerpt": "string", "featureImage": "http://example.com", "metaTitle": "string", "metaDescription": "string", "ogImage": "http://example.com", "publishedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ], "meta": { "total": 0, "page": 0, "limit": 0, "pages": 0 }}{ "error": "string"}Creates a new content item for the authenticated user's site. Slug is auto-generated from title if not provided.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/content" \ -H "Content-Type: application/json" \ -d '{ "title": "string" }'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1", "authorId": "string", "title": "string", "slug": "string", "body": {}, "status": "draft", "contentType": "post", "excerpt": "string", "featureImage": "http://example.com", "metaTitle": "string", "metaDescription": "string", "ogImage": "http://example.com", "publishedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}{ "error": "string", "details": [ { "code": "string", "message": "string", "path": [ "string" ] } ]}{ "error": "string"}{ "error": "string"}{ "error": "string"}Retrieves a single content item by ID for the authenticated user's site.
Path Parameters
Content ID
uuidResponse Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1", "authorId": "string", "title": "string", "slug": "string", "body": {}, "status": "draft", "contentType": "post", "excerpt": "string", "featureImage": "http://example.com", "metaTitle": "string", "metaDescription": "string", "ogImage": "http://example.com", "publishedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}{ "error": "string"}{ "error": "string"}Updates an existing content item for the authenticated user's site.
Path Parameters
Content ID
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1", "authorId": "string", "title": "string", "slug": "string", "body": {}, "status": "draft", "contentType": "post", "excerpt": "string", "featureImage": "http://example.com", "metaTitle": "string", "metaDescription": "string", "ogImage": "http://example.com", "publishedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}{ "error": "string", "details": [ { "code": "string", "message": "string", "path": [ "string" ] } ]}{ "error": "string"}{ "error": "string"}{ "error": "string"}Deletes a content item for the authenticated user's site. This action cannot be undone.
Path Parameters
Content ID
uuidResponse Body
application/json
application/json
curl -X DELETE "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "error": "string"}{ "error": "string"}Publishes a content item, setting status to published and publishedAt timestamp.
Path Parameters
uuidResponse Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/publish"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1", "authorId": "string", "title": "string", "slug": "string", "body": {}, "status": "draft", "contentType": "post", "excerpt": "string", "featureImage": "http://example.com", "metaTitle": "string", "metaDescription": "string", "ogImage": "http://example.com", "publishedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}{ "error": "string", "details": [ { "code": "string", "message": "string", "path": [ "string" ] } ]}{ "error": "string"}{ "error": "string"}Unpublishes a content item, setting status back to draft.
Path Parameters
uuidResponse Body
application/json
application/json
application/json
curl -X POST "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/unpublish"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1", "authorId": "string", "title": "string", "slug": "string", "body": {}, "status": "draft", "contentType": "post", "excerpt": "string", "featureImage": "http://example.com", "metaTitle": "string", "metaDescription": "string", "ogImage": "http://example.com", "publishedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}{ "error": "string"}{ "error": "string"}Lists all version snapshots for a content item with pagination.
Path Parameters
uuidQuery Parameters
1 <= value11 <= value <= 10020Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions"{ "versions": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "contentId": "21aa1683-ca25-4edf-bc18-01ad04a4821b", "version": 0, "title": "string", "body": {}, "createdAt": "2019-08-24T14:15:22Z" } ], "pagination": { "total": 0, "page": 0, "limit": 0, "pages": 0 }}{ "error": "string"}{ "error": "string"}Creates a new version snapshot of the current content state.
Path Parameters
uuidResponse Body
application/json
application/json
application/json
curl -X POST "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "contentId": "21aa1683-ca25-4edf-bc18-01ad04a4821b", "version": 0, "title": "string", "body": {}, "createdAt": "2019-08-24T14:15:22Z"}{ "error": "string"}{ "error": "string"}Retrieves a specific version snapshot of a content item.
Path Parameters
uuid1 <= valueResponse Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions/1"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "contentId": "21aa1683-ca25-4edf-bc18-01ad04a4821b", "version": 0, "title": "string", "body": {}, "createdAt": "2019-08-24T14:15:22Z"}{ "error": "string"}{ "error": "string"}Restores content to a previous version. Creates a snapshot of current state before restoring.
Path Parameters
uuid1 <= valueResponse Body
application/json
application/json
application/json
curl -X POST "https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions/1/restore"{ "restored": true, "newVersion": 0}{ "error": "string"}{ "error": "string"}