Docs · Reference

The document API.

Every tool an AI connection calls is one of these requests. Use it when you are writing a client of your own; use MCP when you are not.

OpenAPI 3.1OAuth 2.1Markdown

What this API is

A cloud copy is a mirror of one document: the same text, stored on the server so an AI connection can read it. It is created when a document is handed to an AI app or given a review link, and it is deleted on its own when you delete it — your local file is never touched.

Two rules hold on every endpoint, and the server enforces both rather than asking a prompt to behave:

  • The author writes. Any other connection can read a shared document, comment on a passage and propose a replacement, but the only call that puts text into the body is the author’s own sync. A proposal is a thread with intent: "rewrite", and it waits.
  • Permission lives on the document. A document is either shared or not shared. There is no per-connection grant and no read-only tier, so turning sharing off cuts every other caller off at once.

If you are integrating an AI app rather than writing an HTTP client, connect it over MCP instead: the same calls, with the anchoring, versioning and idempotency already handled.

Authentication

Bearer tokens from the OAuth 2.1 authorization server at https://api.mindmax.me, obtained with PKCE. Clients register themselves at /oauth/register; the metadata is at /.well-known/oauth-authorization-server. Two scopes exist:

Scope What it allows
mcp:account:read Read a document you can reach, list your own copies, read threads, export.
mcp:account:write Create and update a cloud copy, append, comment, propose a revision.

One endpoint needs no credential: POST /v1/documents/temporary creates a 24-hour copy for a first draft an AI writes before any person is involved. It has no author until someone opens it, so it is readable by anyone holding its id and it counts against no plan.

Endpoints

Base URL https://api.jotdoc.net. The table is generated from the OpenAPI document, so it cannot drift from the spec.

Method Path What it does
GET /v1/documents List the documents you own
POST /v1/documents Create or update a cloud copy
POST /v1/documents/temporary Create a temporary cloud copy without an account
GET /v1/documents/{id} Read a cloud copy
DELETE /v1/documents/{id} Delete the cloud copy
PUT /v1/documents/{id}/share Turn sharing on or off
PATCH /v1/documents/{id}/mirror Append text to the end of the document
GET /v1/documents/{id}/threads Every comment thread on the document
POST /v1/documents/{id}/threads Comment on a passage, or propose a rewrite of it
POST /v1/documents/{id}/threads/{tid}/messages Reply inside a thread
POST /v1/documents/{id}/export Export the current text
GET /healthz Liveness probe and the release actually running

Reading, proposing, writing

A copy is in one of two phases. draft means the text lives only in the cloud — no editor holds it — so an append can still land directly. working means the body lives in someone's editor: they uploaded it from there, or opened the link. From that moment every write that is not the author’s own sync becomes a proposal, and the response says so instead of returning a new version.

Proposals carry the base_version they were written against. If the text has moved since, the server answers 409 takeover_required rather than applying a diff to the wrong sentence — re-read, then propose again.

A comment anchors to a verbatim quote, not to a paragraph number. Send the quote (a whole block is fine) plus a little prefix or suffix when the phrase repeats. If the quote is not in the text, the thread is refused; that is the point — an anchor that cannot be found is a comment about nothing.

Error codes

Read error, never the prose: codes are stable, descriptions are not. The ones you are likely to meet:

Code Status Means
document_not_found 404 No such copy, or it is not shared with this caller — deliberately the same answer.
document_expired 410 A temporary copy past its 24-hour window. The text in anyone’s editor is unaffected.
cloud_doc_limit 403 The plan’s cloud copies are used up; the body carries limit and used.
insufficient_scope 403 The token lacks the write scope for this call.
takeover_required 409 The author opened the text between your read and your write. Propose instead.
thread_limit 403 This document already holds the maximum number of open threads.
invalid_body 400 A required field is missing or empty; the description names it.

Machine-readable

  • OpenAPI 3.1 document — every endpoint, schema and error code on this page.
  • API catalog (RFC 9727) — this API and the MCP server, as a linkset.
  • auth.md — how an agent registers and which credentials it can hold, with the protected-resource metadata at /.well-known/oauth-protected-resource.
  • MCP tool reference — the same surface as tools, with which connection can call each one.