curl --request DELETE \
--url https://studio.weaverse.io/api/v1/content/projects/{projectId}/page-drafts/{pageId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedHeadVersionId": "clz9drf2h4j6l8n0p2r4t6v8"
}
'const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedHeadVersionId: 'clz9drf2h4j6l8n0p2r4t6v8'})
};
fetch('https://studio.weaverse.io/api/v1/content/projects/{projectId}/page-drafts/{pageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://studio.weaverse.io/api/v1/content/projects/{projectId}/page-drafts/{pageId}"
payload = { "expectedHeadVersionId": "clz9drf2h4j6l8n0p2r4t6v8" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text){
"object": "page_draft_discarded",
"pageId": "clz7pg9k2m4n6p8r0t2v4x6z"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "STALE_PAGE",
"message": "The draft head moved since it was read; re-read and retry",
"status": 409
}Discard a page draft
Discards the page’s current draft head. Live content stays as it is, and the draft’s version row is kept in history; only the head pointer is removed. The next GET returns live content again.
Fence. Send expectedHeadVersionId with the headVersionId from GET. The discard is an exact compare-and-set:
- If another save replaced the head since your read, the response is 409
STALE_PAGEand nothing is discarded. - Only an active (unscheduled) draft can be discarded. A scheduled draft, an unknown version or a page without a draft returns 404
PAGE_NOT_FOUND. Cancel the schedule withDELETE /versions/{versionId}first.
Required scope: content:write
curl --request DELETE \
--url https://studio.weaverse.io/api/v1/content/projects/{projectId}/page-drafts/{pageId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedHeadVersionId": "clz9drf2h4j6l8n0p2r4t6v8"
}
'const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedHeadVersionId: 'clz9drf2h4j6l8n0p2r4t6v8'})
};
fetch('https://studio.weaverse.io/api/v1/content/projects/{projectId}/page-drafts/{pageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://studio.weaverse.io/api/v1/content/projects/{projectId}/page-drafts/{pageId}"
payload = { "expectedHeadVersionId": "clz9drf2h4j6l8n0p2r4t6v8" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text){
"object": "page_draft_discarded",
"pageId": "clz7pg9k2m4n6p8r0t2v4x6z"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "UNAUTHORIZED",
"message": "<string>",
"status": 123,
"details": "<unknown>"
}{
"object": "error",
"code": "STALE_PAGE",
"message": "The draft head moved since it was read; re-read and retry",
"status": 409
}Authorizations
Bearer authentication: a shop API key (WEAVERSE_API_KEY), a scoped API key, a delegated MCP OAuth token, or (translation-unit routes only) a project-bound translation agent token. Scopes: content:read — Read projects, pages, theme settings, versions, drafts and translation units. content:write — Save drafts and make non-destructive edits (page items, metadata, SEO, assignments, languages, glossary). Never publishes or deletes. content:publish — Publish drafts, schedule/reschedule/cancel publications, restore versions, publish global sections. content:delete — Delete pages, global sections, languages, static keys, override reverts; required with project:manage for project deletion. project:manage — Create/copy/delete projects, settings, variants, hierarchy, backups, restore-as-new, previews, hostname policy. translations:read — Read translation units only (no general content access). translations:write — Apply translation units only; never mutates page content. A legacy unscoped API key keeps read/write/translation baseline access and every pre-scope endpoint, but never gains publish/delete/project-manage implicitly.
Body
The headVersionId of the draft being discarded, exactly as GET returned it. The discard is refused when the draft head has moved.
1Response
Discarded
The response is of type object.
Was this page helpful?