Docs Open org

API reference

Pages API

Pages

GET /orgs/{org}/daily/{date}

Your daily note for a day, created on first open.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
date requiredpathstringYYYY-MM-DD, or today.

Responses

200
OK. PageView application/json

GET /orgs/{org}/pages

Pages you can read, in tree order (space, parent, position).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
spacequerystringOnly this space (slug or id).
parentquerystringOnly children of this page (short ID), or root for top-level pages.
qquerystringTitle contains.
trashquerybooleanInclude pages in the trash.
limitqueryinteger (int32)Page size.
cursorquerystringCursor.

Responses

200
OK. Paged_PageSummary application/json

POST /orgs/{org}/pages

Creates a page in space, or under parent (one of them is required). With source and external_id, upserts: 200 with import_action updated or skipped when that page was imported before.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.

Request body

application/json, CreatePage.

FieldTypeDescription
external_idstring | nullThe page's id in source.
iconstring | nullIcon.
import_idstring (uuid) | nullThe import batch, undone as a unit.
markdownstring | nullThe text (default: a heading with the title).
parentstring | nullThe parent page (short ID or id).
sourcestring | nullImport provenance (§23.2), with external_id: a repeat updates the page if the text changed and otherwise skips it.
spacestring | nullThe space (slug or id). Required unless parent is given; defaults to the parent's space.
templatestring | nullA template page to copy.
title requiredstringTitle.

Responses

200
OK. PageView application/json
201
Created. PageView application/json

GET /orgs/{org}/pages/{ref}

A page, as JSON, Markdown or safe HTML.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.
formatquerystringjson (default), md or html.

Responses

200
OK. PageView application/json
404
Not found. ProblemBody application/json

PUT /orgs/{org}/pages/{ref}

Replaces a page's text. If-Match is a strict precondition; base_revision merges.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.
If-Matchheaderstring | nullThe page's strong ETag. If supplied, it must match the current revision; a mismatch returns 409 revision_conflict.

Request body

application/json, PutPage.

FieldTypeDescription
base_revisioninteger (int64) | nullThe revision it was based on: an older base is merged three ways.
markdown requiredstringThe full new text.

Responses

200
OK. PageView application/json
409
Conflict. ProblemBody application/json

PATCH /orgs/{org}/pages/{ref}

Applies edit operations (append, prepend, insert_under, replace, set_frontmatter).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.
If-Matchheaderstring | nullThe page's strong ETag. If supplied, it must match the current revision; a mismatch returns 409 revision_conflict.

Request body

application/json, PatchPage.

FieldTypeDescription
base_revisioninteger (int64) | nullThe revision the ops were written against.
ops requiredPageOp[]The operations, applied in order.

Responses

200
OK. PageView application/json
409
Conflict. ProblemBody application/json

DELETE /orgs/{org}/pages/{ref}

Moves a page and its descendants to the trash.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Responses

204
No content

Pages and entries linking here (that you can read).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Responses

200
OK. Paged_Backlink application/json

POST /orgs/{org}/pages/{ref}/duplicate

Copies a page (its entries get new identities).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Request body

application/json, DuplicatePage.

FieldTypeDescription
titlestring | nullThe copy's title (default: <title> (copy)).

Responses

201
Created. PageView application/json

POST /orgs/{org}/pages/{ref}/move

Moves a page (between parents and spaces) with its descendants.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Request body

application/json, MovePage.

FieldTypeDescription
afterstring | nullPut it right after this sibling (short ID).
beforestring | nullPut it right before this sibling (short ID).
parentstring | nullThe new parent (short ID), or "" for top level.
spacestring | nullThe new space (slug or id).

Responses

200
OK. PageView application/json

POST /orgs/{org}/pages/{ref}/publish

Publishes a page read-only at /p/{org}/{slug} (managers).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Request body

application/json, Publish.

FieldTypeDescription
include_childrenbooleanPublish the children too.
slugstring | nullThe public slug (default: the page slug).

Responses

200
OK. Publication application/json

POST /orgs/{org}/pages/{ref}/restore

Restores a page from the trash.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Responses

200
OK. PageView application/json

GET /orgs/{org}/pages/{ref}/restrictions

A page's restrictions (its managers).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Responses

200
OK. Restrictions application/json

PUT /orgs/{org}/pages/{ref}/restrictions

Restricts a page and its descendants to these subjects (a human manager). Restrictions only narrow: role = min(space role, restriction role).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Request body

application/json, Restrictions.

FieldTypeDescription
restrictedbooleanWhether the page is restricted.
restrictions requiredRestriction[]Who may see it.

Responses

200
OK. Restrictions application/json

DELETE /orgs/{org}/pages/{ref}/restrictions

Lifts a page's restrictions (a human manager).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Responses

204
No content

Creates a view (or comment) link for people without accounts (managers).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Request body

application/json, CreateShareLink.

FieldTypeDescription
expires_in_daysinteger (int64) | nullDays until it expires (default 30).
rolestring | nullviewer or commenter.

Responses

201
Created. ShareLink application/json

GET /orgs/{org}/pages/{ref}/versions

A page's versions, newest first.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page's short ID or UUID.

Responses

200
OK. Paged_PageVersion application/json

GET /orgs/{org}/pages/{ref}/versions/{rev}

One version's text.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page.
rev requiredpathinteger (int64)The revision.

Responses

200
OK. PageVersion application/json

POST /orgs/{org}/pages/{ref}/versions/{rev}/restore

Restores a version (as a new revision).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe page.
rev requiredpathinteger (int64)The revision.

Responses

200
OK. PageView application/json