API reference
Documents
Documents endpoints of the SemanticsOn REST API.
List documents
GET/projects/{projectId}/documentsYour documents in the project (documents are private to the account that created them), without body.
Path parameters
projectIdstringrequired
Query parameters
limitintegeroptionalItems per page, 1–100.
1–100 · default 25
cursorstringoptionalPass
nextCursorfrom the previous page to get the next one.at most 200 characters
statusstringoptionalOne of:
draft,in_review,approved,publishedbriefIdstringoptionalat most 64 characters
searchstringoptionalat most 200 characters
curl https://semanticson.com/api/v1/projects/PROJECT_ID/documents \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 200 OK
A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.
Errors use the standard error object.
Create a document
POST/projects/{projectId}/documentsCreates a Markdown document in the project, owned by your account. A first version is saved when body is not empty.
Accepts an Idempotency-Key header for safe retries.
Path parameters
projectIdstringrequired
Request body
titlestringoptional1–200 characters · default "Untitled document"
bodystringoptionalMarkdown
at most 400,000 characters · default ""
kindstringoptionale.g. article, landing-page, product-description
1–40 characters · default "article"
languagestringoptionalDefaults to the project's language
2–12 characters
tonestringoptionalat most 60 characters · default ""
statusstringoptionalOne of:
draft,in_review,approved,publisheddefault "draft"
briefIdstring or nulloptional1–64 characters
Response fields Show 14 fields
object"document"idstringprojectIdstring or nullbriefIdstring or nullexecutionIdstring or nulltitlestringkindstringlanguagestringtonestringstatusstringOne of:
draft,in_review,approved,publishedwordCountnumberbodystringMarkdown; omitted in lists
createdAtstringupdatedAtstringSend this back as
updatedAtin PATCH to avoid overwriting newer changes
curl -X POST https://semanticson.com/api/v1/projects/PROJECT_ID/documents \
-H "Authorization: Bearer $SEMANTICSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Espresso grind size: the complete chart",
"body": "## Why grind size matters\n\nGrind size controls how fast water flows…",
"briefId": "cm1brief…",
"status": "draft"
}'Response · 201 Created
A JSON object with the fields listed under Response fields.
Errors use the standard error object.
Get a document
GET/documents/{documentId}Path parameters
documentIdstringrequiredThe document id
1–64 characters
Response fields Show 14 fields
object"document"idstringprojectIdstring or nullbriefIdstring or nullexecutionIdstring or nulltitlestringkindstringlanguagestringtonestringstatusstringOne of:
draft,in_review,approved,publishedwordCountnumberbodystringMarkdown; omitted in lists
createdAtstringupdatedAtstringSend this back as
updatedAtin PATCH to avoid overwriting newer changes
curl https://semanticson.com/api/v1/documents/DOCUMENT_ID \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 200 OK
A JSON object with the fields listed under Response fields.
Errors use the standard error object.
Update a document
PATCH/documents/{documentId}Send only the fields to change.
Avoid overwriting newer edits: send the updatedAt you last read. If the document changed since (in the editor, another integration or tab), nothing is saved and you get 409 conflict with the current updatedAt in details — fetch the document, merge, and retry (or send force: true to overwrite).
When title or body change, a version is saved automatically at most every 10 minutes (like the editor's autosave); send versionNote to always save a named version of the new content.
Accepts an Idempotency-Key header for safe retries.
Path parameters
documentIdstringrequiredThe document id
1–64 characters
Request body
updatedAtstringoptionalThe
updatedAtyou last read (ISO timestamp)at most 40 characters
forcebooleanoptionalOverwrite even if the document changed since
updatedAtdefault false
titlestringoptional1–200 characters
bodystringoptionalMarkdown
at most 400,000 characters
kindstringoptionale.g. article, landing-page, product-description
1–40 characters
languagestringoptional2–12 characters
tonestringoptionalat most 60 characters
statusstringoptionalOne of:
draft,in_review,approved,publishedbriefIdstring or nulloptional1–64 characters
versionNotestringoptional1–200 characters
Response fields Show 14 fields
object"document"idstringprojectIdstring or nullbriefIdstring or nullexecutionIdstring or nulltitlestringkindstringlanguagestringtonestringstatusstringOne of:
draft,in_review,approved,publishedwordCountnumberbodystringMarkdown; omitted in lists
createdAtstringupdatedAtstringSend this back as
updatedAtin PATCH to avoid overwriting newer changes
curl -X PATCH https://semanticson.com/api/v1/documents/DOCUMENT_ID \
-H "Authorization: Bearer $SEMANTICSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"updatedAt": "2026-11-20T10:15:00.000Z",
"body": "## Why grind size matters\n\nUpdated text…",
"versionNote": "Edited in our CMS"
}'Response · 200 OK
A JSON object with the fields listed under Response fields.
Errors use the standard error object.
Delete a document
DELETE/documents/{documentId}Deletes the document and all its versions.
Accepts an Idempotency-Key header for safe retries.
Path parameters
documentIdstringrequiredThe document id
1–64 characters
curl -X DELETE https://semanticson.com/api/v1/documents/DOCUMENT_ID \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 204 No Content
Success returns an empty body (204) or a small confirmation object.
Errors use the standard error object.
List saved versions
GET/documents/{documentId}/versionsNewest first, without bodies. The 50 most recent versions are kept.
Path parameters
documentIdstringrequiredThe document id
1–64 characters
Query parameters
limitintegeroptionalItems per page, 1–100.
1–100 · default 25
cursorstringoptionalPass
nextCursorfrom the previous page to get the next one.at most 200 characters
curl https://semanticson.com/api/v1/documents/DOCUMENT_ID/versions \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 200 OK
A list object: { "object": "list", "data": [ … ], "hasMore": false, "nextCursor": null }. See pagination.
Errors use the standard error object.
Restore a version
POST/documents/{documentId}/versions/{versionId}/restoreReplaces the title and body with the version's. The current content is saved as a version first, so a restore can always be undone.
Accepts an Idempotency-Key header for safe retries.
Path parameters
documentIdstringrequiredThe document id
1–64 characters
versionIdstringrequiredThe version id
1–64 characters
No request body. Send an empty body or {}.
Response fields Show 14 fields
object"document"idstringprojectIdstring or nullbriefIdstring or nullexecutionIdstring or nulltitlestringkindstringlanguagestringtonestringstatusstringOne of:
draft,in_review,approved,publishedwordCountnumberbodystringMarkdown; omitted in lists
createdAtstringupdatedAtstringSend this back as
updatedAtin PATCH to avoid overwriting newer changes
curl -X POST https://semanticson.com/api/v1/documents/DOCUMENT_ID/versions/VERSION_ID/restore \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 200 OK
A JSON object with the fields listed under Response fields.
Errors use the standard error object.
Download a document
GET/documents/{documentId}/exportReturns the file itself (content-disposition: attachment), not JSON. Formats not included in your plan return 402 export_not_in_plan.
Path parameters
documentIdstringrequiredThe document id
1–64 characters
Query parameters
formatstringrequiredFile format: csv, json, md, html, xlsx, pdf, docx. Available formats depend on your plan (
plan.features.exportsin GET /me).One of:
csv,json,md,html,xlsx,pdf,docx
curl https://semanticson.com/api/v1/documents/DOCUMENT_ID/export \
-H "Authorization: Bearer $SEMANTICSON_API_KEY"Response · 200 OK
A JSON object. Objects carry an object type and an id; timestamps are ISO 8601 strings.
Errors use the standard error object.
Propose publishing a document to a connected website
POST/documents/{documentId}/publishCreates a pending post.create change for one of the project's connected websites (Markdown is converted to HTML). Nothing is published until a person approves the change — in SemanticsOn, in the WordPress admin, or with POST /changes/{changeId}/approve. Returns the proposed change; follow it with GET /changes/{changeId} or the change.* webhooks.
Accepts an Idempotency-Key header for safe retries.
Path parameters
documentIdstringrequiredThe document id
1–64 characters
Request body
siteIdstringrequiredThe connected site id
1–64 characters
statusstringoptionalPost status on the website once the change is approved and applied
One of:
draft,publishdefault "draft"
typestringoptionalPost type on the website, e.g. post or page
1–40 characters · default "post"
slugstringoptionalat most 200 characters
excerptstringoptionalat most 5,000 characters
metaTitlestringoptionalat most 300 characters
metaDescriptionstringoptionalat most 1,000 characters
categoriesarray of stringsoptionalat most 20 items
tagsarray of stringsoptionalat most 50 items
Response fields Show 22 fields
object"change"idstringsiteIdstringprojectIdstringkindstringOne of:
meta.update,post.update,post.create,post.delete,schema.set,redirect.create,redirect.update,redirect.delete,term.create,term.update,term.delete,media.update,media.import,product.variation.update,link.insert,noindex.settitlestringstatusstringOne of:
pending,approved,applied,failed,rejected,reverted,cancelledtargetobjectpayloadobjectpreviousany or nullresultany or nullerrorstring or nullsourcestringauditResultIdstring or nulldecidedViastring or nulldecidedAtstring or nullappliedAtstring or nullrevertRequestedbooleanrevertNeedsApprovalbooleanrevertedAtstring or nullcreatedAtstringupdatedAtstring
curl -X POST https://semanticson.com/api/v1/documents/DOCUMENT_ID/publish \
-H "Authorization: Bearer $SEMANTICSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"siteId": "cm1site…",
"status": "publish",
"type": "post",
"metaDescription": "Dial in espresso with one simple grind size chart.",
"categories": [
"Guides"
]
}'Response · 201 Created
A JSON object with the fields listed under Response fields.
Errors use the standard error object.