https://scribe.skeptrune.com/api.
The full interactive reference is generated from the same OpenAPI 3.1 spec the server serves at /openapi.json — browse it in the API reference tab.
Authentication
Two credential types, checked in this order:Errors
Every non-2xx response has the same envelope:code is a stable machine-readable value: validation_error, unauthorized, user_session_required, forbidden, not_found, conflict, version_gone, stale_version, payload_too_large, unsupported_media_type, or internal_error. message is a human-readable explanation and may change; branch on code.
Writing content converges into live editors
The flagship example of API-first design:PUT /api/docs/{id}/content takes raw text/markdown (up to 4 MB) and applies it through the document’s collaborative session, not around it.
GET /api/docs/{id}/content returns the current text/markdown — including edits made seconds ago in someone’s browser.
Concurrent editing & conflict resolution
Agents editing over the API while humans type in the browser is the designed-for case. The API is optimistic — no locks — and merges are conflict-free, so nobody’s keystrokes are lost.- GET returns a version token.
GET /api/docs/{id}/contentsets anX-Doc-Versionresponse header (mirrored as a quotedETag) naming the exact document state you received. - PATCH merges your edit.
PATCH /api/docs/{id}/contenttakes your edited markdown astext/markdownplus the requiredX-Base-Versionheader (the token from step 1). The server forks the document at your base version, diffs your markdown against that snapshot, and merges only your changes into the live document. Edits humans made since your GET merge in alongside yours instead of being overwritten. The response —{"merged": true, "wordCount": ..., "charCount": ..., "version": "..."}— includes the new version token, so consecutive edits can chain without re-GETting. - Recovery loop. Version tokens are ephemeral (roughly the last 15 writes, at most 24 hours, and they don’t survive server restarts). If your base has expired, PATCH fails with
409version_gone: re-GET the content, reapply your edit to the fresh markdown, and PATCH again with the new token. Because merges are conflict-free, one retry always suffices.
PUT /content stays a full replace and remains unconditional by default. To guard a replace against concurrent edits, send If-Match (the quoted ETag) or X-Base-Version: if the document changed since that version, the PUT fails with 412 stale_version and writes nothing — re-GET, or switch to PATCH if a merge is what you actually want.
Conventions
- Base URL:
https://scribe.skeptrune.com— all operation paths in the reference are relative to it. - Formats: JSON everywhere, except document content, which is
text/markdown. - Timestamps: epoch milliseconds.
- Activity: every mutation — human or API key — lands in the activity feed with its actor, so automation stays auditable.