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.

RouteWhat it does
GET /v1/orgs/:orgId/pages/liveA 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/pagesThe page tree, or the trash with archived=1.
POST /v1/orgs/:orgId/pagesCreates a page or database, at the top level or under a parent.
GET /v1/orgs/:orgId/pages/searchSearches page titles and text.
GET /v1/orgs/:orgId/pages/:pageIdA page with its content. Databases include their rows; rows include their database's schema.
PATCH /v1/orgs/:orgId/pages/:pageIdRenames, moves, trashes or restores a page, or edits a database's properties or a row's values.
PUT /v1/orgs/:orgId/pages/:pageId/contentSaves 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/collabCo-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/seedThe first editor's document, made from the stored content. 409 if someone else's came first.
POST /v1/orgs/:orgId/pages/:pageId/collab/updatesAn update too large for the socket (a big paste); relayed like socket updates.
GET /v1/orgs/:orgId/pages/:pageId/threadsComment threads on the page (kept apart from the shared document; they survive a reset).
POST /v1/orgs/:orgId/pages/:pageId/threadsA new thread with its first comment (anchor: the block and text it is about).
POST /v1/orgs/:orgId/pages/:pageId/threads/:threadIdReplies, edits, deletions, resolving and reactions. thread is null once it's gone.
GET /v1/orgs/:orgId/pages/:pageId/collab/updatesUpdates after after (a gap, or one announced as pull); reset when the document was replaced.
DELETE /v1/orgs/:orgId/pages/:pageIdMoves a page to the trash.
GET /v1/orgs/:orgId/pages/:pageId/historySaved versions of a page's content, newest first (kept 30 days after they're replaced).
GET /v1/orgs/:orgId/pages/:pageId/history/:versionIdOne saved version's content, to preview or restore (restoring saves it as a new version).
POST /v1/orgs/:orgId/pages/:pageId/filesA 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/:fileIdA one-hour link to a file in a page.
GET /v1/orgs/:orgId/favoritesThe caller's favorite pages, oldest first.
PUT /v1/orgs/:orgId/favoritesReorders the caller's favorites: page ids in the new order.
PUT /v1/orgs/:orgId/favorites/:pageIdAdds a page to the caller's favorites. Adding it again keeps its place.
DELETE /v1/orgs/:orgId/favorites/:pageIdRemoves a page from the caller's favorites.