API
Notes pages
Pages, databases, search, trash and favorites.
See Notes.
Every route below, with its parameters, request and response, errors and samples, is in the API reference.
| Route | What it does |
|---|---|
GET /v1/orgs/:orgId/pages/live | A one-time ticket for this tab's socket (2 minutes): the org's change events, and co-editing of the page it joins. socket is null where the stage has none. |
GET /v1/orgs/:orgId/pages | The page tree, or the trash with archived=1. |
POST /v1/orgs/:orgId/pages | Creates a page or database, at the top level or under a parent. |
GET /v1/orgs/:orgId/pages/search | Searches page titles and text. |
GET /v1/orgs/:orgId/pages/:pageId | A page with its content. Databases include their rows; rows include their database's schema. |
PATCH /v1/orgs/:orgId/pages/:pageId | Renames, moves, trashes or restores a page, or edits a database's properties or a row's values. |
PUT /v1/orgs/:orgId/pages/:pageId/content | Saves page content. baseVersion is the version you started from; if the page has changed since, the save fails with 409. |
GET /v1/orgs/:orgId/pages/:pageId/collab | Co-editing: the page's shared document (base64 Yjs state, epoch: null before anyone opened it this way), and a one-time ticket for the socket (socket is null where co-editing isn't set up). |
POST /v1/orgs/:orgId/pages/:pageId/collab/seed | The first editor's document, made from the stored content. 409 if someone else's came first. |
POST /v1/orgs/:orgId/pages/:pageId/collab/updates | An update too large for the socket (a big paste); relayed like socket updates. |
GET /v1/orgs/:orgId/pages/:pageId/threads | Comment threads on the page (kept apart from the shared document; they survive a reset). |
POST /v1/orgs/:orgId/pages/:pageId/threads | A new thread with its first comment (anchor: the block and text it is about). |
POST /v1/orgs/:orgId/pages/:pageId/threads/:threadId | Replies, edits, deletions, resolving and reactions. thread is null once it's gone. |
GET /v1/orgs/:orgId/pages/:pageId/collab/updates | Updates after after (a gap, or one announced as pull); reset when the document was replaced. |
DELETE /v1/orgs/:orgId/pages/:pageId | Moves a page to the trash. |
GET /v1/orgs/:orgId/pages/:pageId/history | Saved versions of a page's content, newest first (kept 30 days after they're replaced). |
GET /v1/orgs/:orgId/pages/:pageId/history/:versionId | One saved version's content, to preview or restore (restoring saves it as a new version). |
POST /v1/orgs/:orgId/pages/:pageId/files | A link to upload an image or file into a page (PUT the bytes with the declared type within 15 minutes). |
GET /v1/orgs/:orgId/pages/:pageId/files/:fileId | A one-hour link to a file in a page. |
GET /v1/orgs/:orgId/favorites | The caller's favorite pages, oldest first. |
PUT /v1/orgs/:orgId/favorites | Reorders the caller's favorites: page ids in the new order. |
PUT /v1/orgs/:orgId/favorites/:pageId | Adds a page to the caller's favorites. Adding it again keeps its place. |
DELETE /v1/orgs/:orgId/favorites/:pageId | Removes a page from the caller's favorites. |