Toast
API Reference

Content

CRUD operations for site content, scoped to the authenticated user's site.

List content for site

GET
/api/content

Retrieves content items for the authenticated user's site with pagination, sorting, and filtering.

Query Parameters

page?integer

Page number

Range1 <= value
Default1
limit?integer

Items per page

Range1 <= value <= 100
Default20
sort?string

Sort field

Default"updated_at"
Value in"created_at""updated_at""published_at""title"
status?string

Filter by status

Value in"draft""published"
type?string

Filter by content type

Value in"post""page"

Response Body

Content list

application/json
  1. response
data*array<>
meta*
Example Request
curl -X GET 'https://example.com/api/content'
Example Response
{  "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  }}

Create content

POST
/api/content

Creates a new content item for the authenticated user's site. Slug is auto-generated from title if not provided.

Request Body

application/json
  1. body
title*string

Content title

Length1 <= length
body?|

JSON content body

status?string
Default"draft"
Value in"draft""published"
slug?string

URL slug (auto-generated from title if omitted)

contentType?string
Default"post"
Value in"post""page"
excerpt?string
Lengthlength <= 500
featureImage?string
Formaturi
metaTitle?string
Lengthlength <= 300
metaDescription?string
Lengthlength <= 500
ogImage?string
Formaturi

Response Body

Content created

application/json
  1. response
id*string
Formatuuid
siteId*string
Formatuuid
authorId*string
title*string
slug?string
body?|

JSON content body

status*string
Value in"draft""published"
contentType*string
Value in"post""page"
excerpt?string
featureImage?string
Formaturi
metaTitle?string
metaDescription?string
ogImage?string
Formaturi
publishedAt?string
Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/content' \  -H 'Content-Type: application/json' \  -d '{  "title": "string"}'
Example Response
{  "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"}

Get content by ID

GET
/api/content/{id}

Retrieves a single content item by ID for the authenticated user's site.

Path Parameters

id*string

Content ID

Formatuuid

Response Body

Content item

application/json
  1. response
id*string
Formatuuid
siteId*string
Formatuuid
authorId*string
title*string
slug?string
body?|

JSON content body

status*string
Value in"draft""published"
contentType*string
Value in"post""page"
excerpt?string
featureImage?string
Formaturi
metaTitle?string
metaDescription?string
ogImage?string
Formaturi
publishedAt?string
Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X GET 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{  "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"}

Update content

PUT
/api/content/{id}

Updates an existing content item for the authenticated user's site.

Path Parameters

id*string

Content ID

Formatuuid

Request Body

application/json
  1. body
title?string
Length1 <= length
body?|null
status?string
Value in"draft""published"
slug?string
excerpt?string
Lengthlength <= 500
featureImage?string
Formaturi
metaTitle?string
Lengthlength <= 300
metaDescription?string
Lengthlength <= 500
ogImage?string
Formaturi

Response Body

Content updated

application/json
  1. response
id*string
Formatuuid
siteId*string
Formatuuid
authorId*string
title*string
slug?string
body?|

JSON content body

status*string
Value in"draft""published"
contentType*string
Value in"post""page"
excerpt?string
featureImage?string
Formaturi
metaTitle?string
metaDescription?string
ogImage?string
Formaturi
publishedAt?string
Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X PUT 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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"}

Delete content

DELETE
/api/content/{id}

Deletes a content item for the authenticated user's site. This action cannot be undone.

Path Parameters

id*string

Content ID

Formatuuid

Response Body

Content deleted

Example Request
curl -X DELETE 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
Empty

Publish content

POST
/api/content/{id}/publish

Publishes a content item, setting status to published and publishedAt timestamp.

Path Parameters

id*string
Formatuuid

Response Body

Content published

application/json
  1. response
id*string
Formatuuid
siteId*string
Formatuuid
authorId*string
title*string
slug?string
body?|

JSON content body

status*string
Value in"draft""published"
contentType*string
Value in"post""page"
excerpt?string
featureImage?string
Formaturi
metaTitle?string
metaDescription?string
ogImage?string
Formaturi
publishedAt?string
Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/publish'
Example Response
{  "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"}

Unpublish content

POST
/api/content/{id}/unpublish

Unpublishes a content item, setting status back to draft.

Path Parameters

id*string
Formatuuid

Response Body

Content unpublished

application/json
  1. response
id*string
Formatuuid
siteId*string
Formatuuid
authorId*string
title*string
slug?string
body?|

JSON content body

status*string
Value in"draft""published"
contentType*string
Value in"post""page"
excerpt?string
featureImage?string
Formaturi
metaTitle?string
metaDescription?string
ogImage?string
Formaturi
publishedAt?string
Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/unpublish'
Example Response
{  "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"}

List content versions

GET
/api/content/{id}/versions

Lists all version snapshots for a content item with pagination.

Path Parameters

id*string
Formatuuid

Query Parameters

page?integer
Range1 <= value
Default1
limit?integer
Range1 <= value <= 100
Default20

Response Body

Version list

application/json
  1. response
versions*array<>
pagination*
Example Request
curl -X GET 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions'
Example Response
{  "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  }}

Create version snapshot

POST
/api/content/{id}/versions

Creates a new version snapshot of the current content state.

Path Parameters

id*string
Formatuuid

Response Body

Version created

application/json
  1. response
id*string
Formatuuid
contentId*string
Formatuuid
version*integer
title*string
body?|null
createdAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "contentId": "21aa1683-ca25-4edf-bc18-01ad04a4821b",  "version": 0,  "title": "string",  "body": {},  "createdAt": "2019-08-24T14:15:22Z"}

Get specific version

GET
/api/content/{id}/versions/{version}

Retrieves a specific version snapshot of a content item.

Path Parameters

id*string
Formatuuid
version*integer
Range1 <= value

Response Body

Version details

application/json
  1. response
id*string
Formatuuid
contentId*string
Formatuuid
version*integer
title*string
body?|null
createdAt*string
Formatdate-time
Example Request
curl -X GET 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions/1'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "contentId": "21aa1683-ca25-4edf-bc18-01ad04a4821b",  "version": 0,  "title": "string",  "body": {},  "createdAt": "2019-08-24T14:15:22Z"}

Restore version

POST
/api/content/{id}/versions/{version}/restore

Restores content to a previous version. Creates a snapshot of current state before restoring.

Path Parameters

id*string
Formatuuid
version*integer
Range1 <= value

Response Body

Version restored

application/json
  1. response
restored*boolean
newVersion*integer
Example Request
curl -X POST 'https://example.com/api/content/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions/1/restore'
Example Response
{  "restored": true,  "newVersion": 0}