Save page content
const url = 'https://flow.work.optidata.cloud/api/categories/993/pages/2927/contents/4508';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":"[{\"type\":\"h1\",\"children\":[{\"text\":\"Onboarding checklist\"}]},{\"type\":\"p\",\"children\":[{\"text\":\"Request a laptop and set up your Optiwork account on day one. Read the security handbook and enable two-factor authentication.\"}]}]"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://flow.work.optidata.cloud/api/categories/993/pages/2927/contents/4508 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "data": "[{\"type\":\"h1\",\"children\":[{\"text\":\"Onboarding checklist\"}]},{\"type\":\"p\",\"children\":[{\"text\":\"Request a laptop and set up your Optiwork account on day one. Read the security handbook and enable two-factor authentication.\"}]}]" }'Saves a document into a page version. The caller must be able to edit the page.
- Without
draft, the document replaces the content of{pageContent}, which must be a draft — a published version can no longer change (403). - With
draft: true, a new draft is created from the document, whatever{pageContent}is. Use this to start revising a published page; read the new draft’sidfrom the response.
The response confirms the save without echoing data.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Id of the category. Read it from GET /categories.
Id of a page of that category.
Id of a version of that page — a page’s page_content_id, or the id returned when saving a new draft.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The document, as a JSON-encoded array of editor block nodes.
true to create a new draft from data instead of updating {pageContent}.
Examples
Save into the current draft
{ "data": "[{\"type\":\"h1\",\"children\":[{\"text\":\"Onboarding checklist\"}]},{\"type\":\"p\",\"children\":[{\"text\":\"Request a laptop and set up your Optiwork account on day one. Read the security handbook and enable two-factor authentication.\"}]}]"}Start a new draft from a published version
{ "data": "[{\"type\":\"p\",\"children\":[{\"text\":\"Second revision draft.\"}]}]", "draft": true}Responses
Section titled “ Responses ”The saved version, without its document.
A page version without its document.
object
Id of the user who started this version.
Optional label of the version.
Examples
{ "id": 4508, "page_id": 2927, "user_id": 20, "name": null, "status": "draft", "created_at": "2026-10-19T13:50:45.000000Z", "updated_at": "2026-10-19T13:51:31.000000Z", "deleted_at": null}A new draft was created
{ "id": 4510, "page_id": 2927, "user_id": 20, "name": null, "status": "draft", "created_at": "2026-10-19T13:51:48.000000Z", "updated_at": "2026-10-19T13:51:48.000000Z", "deleted_at": null}No authentication key was sent.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller may not edit the page, or {pageContent} is already published and draft was not set.
Generic error envelope used by permission, lookup and framework failures.
object
A rule enforced by Papers itself — a version that can no longer change,
a special page. status repeats the HTTP status; help is a hint for
the end user and is often empty.
object
Examples
{ "message": "This action is unauthorized."}Version already published
{ "error": "Content entry is not a draft, unable to update.", "status": 403, "help": ""}No such resource — or it does not belong to the category or page in the path.
Generic error envelope used by permission, lookup and framework failures.
object
Examples
{ "message": "No query results for model [App\\Models\\Page] 999999"}The authentication key is expired or not recognised. Get a fresh one and retry.
Authentication failures use an error key rather than message.
object
Examples
{ "error": "JWT passport expired: Passport expired"}The body failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The data field is required.", "errors": { "data": [ "The data field is required." ] }}