Comments, suggestions, and per-user sharing are fully supported by the REST API today and everything below works over HTTP — the in-app surfaces for them (the comment overlay and the full share menu) are still landing in the editor UI.
Threads
Every thread is anchored to a range of document text and carries:- A kind:
commentorsuggestion. - The quoted text the range covered when the thread was created.
- A message history — anyone with comment access can reply.
- A status:
open,resolved(comments), oraccepted/rejected(suggestions).
POST /api/docs/{id}/threads, reply with POST /api/threads/{id}/messages, and resolve or reopen it as the discussion concludes.
Anchors that survive edits
Thread anchors are not character offsets — they are Yjs relative positions, identifiers that name a spot in the CRDT’s edit history. As collaborators insert and delete text around (or inside) a commented range, the anchor keeps resolving to the text it was attached to, concurrently and offline-tolerantly, with no server-side reconciliation step.Suggestions
A suggestion is a thread withproposedText: “replace this range with that text.” Accepting one (POST /api/threads/{id}/accept) is not a text-file patch — the document’s Durable Object resolves the anchor against the live document and splices the replacement into the collaborative session, so the edit appears instantly in every open editor and merges cleanly with concurrent typing.
If the anchored text has been deleted by the time someone accepts, the anchor no longer resolves: the API returns a conflict and the thread stays open rather than applying the edit somewhere wrong. Rejecting a suggestion marks the thread rejected without touching the document.
Sharing model
Access to a document is resolved from three layers:Scope: workspace or private
Scope: workspace or private
Every document (and folder) has a scope. Workspace documents are readable and editable by every member of the organization. Private documents belong to their owner and are invisible to everyone else until shared.
Public read-only links
Public read-only links
Enabling the public link mints an unguessable token; anyone with the URL
scribe.skeptrune.com/share/<token> can read (and only read) the document, no account required. Disable the link at any time to revoke access; enabling it again mints a fresh token, so old URLs stay dead. Only the document owner can manage the public link.viewer or commenter who opens a document gets a read-only WebSocket that receives every update live but cannot write a single character.