Skip to main content

Post mutation endpoints

Six endpoints change a document you've already published. All accept an API key or a session and fall under the general rate limit (600 requests a minute per IP). None of them uses a document slot on Free, so they work even when a workspace is at 50 of 50.

:postId is the post's UUID or its slug; scope slugs with ?workspaceId= and ?projectId= (see Post IDs and slugs).

Who can do what​

ActionWhoEndpoint
Publish a new version, retagThe author and any active member of the document's workspaceupdate, tags
Change visibility or project as part of an updateThe author, workspace owners and adminsupdate with visibility or projectId/projectSlug
Change visibility, unpublish, deleteThe author, workspace owners and adminsvisibility, unpublish, DELETE

These are the same rules the dashboard follows. Anyone else who can read the document gets 403 forbidden. A document you can't read, such as a teammate's private one or another workspace's, answers 404 not_found.

A slug finds any document you can read in the workspace you scope it to (the CLI sends its active workspace). Without workspaceId it looks only in your own workspaces, never another one's. A UUID works anywhere you have access.

POST /api/v1/posts/:postId/update​

Publishes new content as the next version. The URL doesn't change unless the update also moves the document to another project.

Request body​

{
"markdown": "# Q3 investor update\n\nRevenue grew 21% quarter over quarter.",
"title": "Q3 investor update",
"workspaceId": "ws_123",
"tags": ["investors", "q3"],
"sourcePath": "updates/q3-investor-update.md",
"baseVersionNumber": 3
}
FieldRequiredNotes
markdownyes1 to 1,000,000 characters
workspaceIdyesRequired by validation; the document's own workspace is always used
titleno1 to 255 characters. Omit it to take the title from the Markdown again
visibilitynoOmit to keep the current visibility. Changing it needs author, owner or admin
confirmPublicnoMust be true when visibility is public
tagsnoOmit to keep the current tags. [] clears them. Up to 20
projectId / projectSlugnoMove to this project in the same workspace. Needs author, owner or admin. A taken slug gets a -2 suffix
sourcePathnoUp to 1024 characters
baseVersionNumbernoThe version your copy came from. If the document has moved past it, nothing is written and you get 409 version_conflict

Send X-OpenDocs-Client so the version records which agent made it.

Response​

{
"postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f",
"versionId": "3c5e7a9b-1d2f-4a6c-8e0b-2d4f6a8c1e3b",
"versionNumber": 4,
"unchanged": false,
"contentHash": "9a1e...",
"slug": "q3-investor-update",
"url": "/halvard/projects/investors/q3-investor-update",
"publicUrl": "https://opendocs.cc/halvard/projects/investors/q3-investor-update",
"title": "Q3 investor update",
"visibility": "workspace",
"tags": ["investors", "q3"],
"projectId": "proj_456",
"projectSlug": "investors",
"projectName": "Investors",
"isDefaultProject": false
}

When the Markdown is byte-identical to the current version, unchanged is true, versionNumber stays the same and no version is created. Title, visibility, tag and project changes still apply.

publicUrl is the full link to share, on the workspace's custom domain when the domain is active (see the publish response).

Errors​

StatuserrorWhen
400invalid_requestBody failed validation (missing markdown or workspaceId, public without confirmPublic)
400update_failedThe document is unpublished ("Cannot update an unpublished post."), or the save failed
403forbiddenYou aren't a member of its workspace, or you tried to change visibility or project without author, owner or admin rights
404not_foundNo document matches, or you can't read it
404project_not_foundThe target project doesn't exist in this workspace
409version_conflictbaseVersionNumber is behind the current version
{
"error": "version_conflict",
"message": "The document is at version 4, but your copy is based on version 3. Pull the latest version and re-apply your changes, or retry with force to overwrite.",
"currentVersionNumber": 4,
"baseVersionNumber": 3,
"currentVersionCreatedAt": "2026-10-14T08:30:00.000Z"
}

POST /api/v1/posts/:postId/unpublish​

Takes the document offline. Its Markdown and versions are kept and its slot on Free is freed. The author, workspace owners and admins.

{
"postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f",
"unpublished": true
}
StatuserrorWhen
400unpublish_failedAlready unpublished, or the change failed. The message is "Unable to unpublish document."
403forbiddenYou aren't the author, a workspace owner or an admin
404not_foundNo document matches, or you can't read it

update doesn't work on an unpublished document. To bring one back, publish its Markdown again with POST /api/v1/publish, which creates a new document and counts against the Free cap.

POST /api/v1/posts/:postId/visibility​

Changes visibility without new Markdown. The author, workspace owners and admins.

{
"visibility": "public",
"confirmPublic": true
}

visibility is private, workspace or public. confirmPublic: true is required for public. A public document is visible outside the workspace only while the workspace allows public documents.

{
"postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f",
"visibility": "public",
"url": "/halvard/projects/investors/q3-investor-update",
"publicUrl": "https://notes.halvard.example/projects/investors/q3-investor-update"
}

publicUrl follows the new visibility: making a document public in a workspace with an active custom domain returns the custom-domain link.

StatuserrorWhen
400invalid_visibilityvisibility isn't private, workspace or public
400visibility_change_failedpublic without confirmPublic: true (message "Unable to change document visibility."), or the document is unpublished ("Cannot change visibility of an unpublished post.")
403forbiddenYou aren't the author, a workspace owner or an admin
404not_foundNo document matches, or you can't read it

PATCH /api/v1/posts/:postId/tags​

Adds and removes tags without resending the list. Any active member of the document's workspace.

{
"add": ["board"],
"remove": ["draft"]
}

At least one of add or remove must be non-empty. Each takes up to 20 tags of 1 to 64 characters; tags are lowercased. A document can have at most 20.

{
"postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f",
"tags": ["board", "investors", "q3"]
}
StatuserrorWhen
400invalid_requestBoth lists empty, or bad types
400tag_update_failedThe result would have more than 20 tags
403forbiddenYou aren't a member of the document's workspace
404not_foundNo document matches, or you can't read it

DELETE /api/v1/posts/:postId​

Deletes the document, its versions and tags for good, frees the slug and, if it was published, its Free slot. The author, workspace owners and admins. This can't be undone.

{
"postId": "8d0f3c1e-2b4a-4c6d-9e8f-7a6b5c4d3e2f",
"deleted": true,
"slug": "q3-investor-update"
}
StatuserrorWhen
400delete_failedThe delete failed. The message is "Unable to delete document."
403forbiddenYou aren't the author, a workspace owner or an admin
404not_foundNo document matches, or you can't read it