Writer's bible

Each book has a set of reference documents — one per kind — that the chapter writer reads as canon: characters, plot_outline, theme_outline, style_guide, style_references, worldbuilding, research_notes, glossary, synopsis, lore, setting_bible and era_research. Every overwrite snapshots the previous content first, so nothing is lost. An unknown kind is a 400.

List documents

GET/v1/books/{bookId}/documentsscope: books:read

Returns the saved documents (kind, title, chars, updatedAt — no bodies) plus kinds, the full catalog with a title and blurb for each, so you can render a picker without hard-coding it.

Read one document

GET/v1/books/{bookId}/documents/{kind}scope: books:read

Returns { kind, title, content, attachments, updatedAt }, or 404 when nothing has been saved for that kind yet.

Write one document

PUT/v1/books/{bookId}/documents/{kind}scope: books:write

Upserts the document. Body: content (Markdown, up to 200,000 characters) and an optional title (defaults to the kind's catalog title). The prior content is snapshotted to the revisions list first.

curl -X PUT "$ANTHRA_BASE/books/$BOOK/documents/style_guide" \
  -H "authorization: Bearer $ANTHRA_TOKEN" \
  -H "content-type: application/json" \
  -d '{ "content": "## POV\nClose third, past tense. Never head-hop." }'

Draft a document with AI

POST/v1/books/{bookId}/documents/{kind}/draftscope: generation:run

Drafts the document from the premise, the book's other bible documents and its first written chapters, then saves it. Charges one assist credit before the model runs; the credit is refunded on any failure, including both refusals below.

FieldTypeNotes
hintstringOptional direction for the model (max 2,000 characters).
forcebooleanRequired to overwrite a document that already has content (alias: confirm). The old content is snapshotted first.

Responses: 200 with the saved document (kind, title, content, chars); 409 confirmation_required with previousChars when the document is non-empty and force was not set; 400 with needsPremise: true when the book has no premise yet; 402 when the account is out of credits.

List revisions

GET/v1/books/{bookId}/documents/{kind}/revisionsscope: books:read

Saved snapshots, newest first: id, reason (what overwrote it), previousChars, previousAttachments and createdAt. Bodies are omitted — restore one to see it.

Restore a revision

POST/v1/books/{bookId}/documents/{kind}/revisions/{revisionId}/restorescope: books:write

Rolls the document back to the snapshot. The current content is snapshotted first, so a restore can itself be undone. A revision id that belongs to another book or kind returns 404.