D Docs · AI Computer Company Open Docs ↗

Revisions API

Checkpoints, revision history, and revert.

All paths are relative to https://docs.aicomputercompany.com/api. Background: Revisions & checkpoints.

Create a checkpoint

POST /docs/:id/checkpoints

Creates a named save point.

Body (all fields optional):

FieldTypeDescription
markdownstringContent to checkpoint. Defaults to the latest revision content.
reasonstringMachine-readable reason, e.g. "manual-save".
messagestringHuman-readable revision message.

Response — 201: {"document": {…}, "revision": {…}}

curl -X POST https://docs.aicomputercompany.com/api/docs/doc_abc123/checkpoints \
  -H 'Content-Type: application/json' \
  -H 'x-actor-id: agent_demo' \
  -d '{"reason": "manual-save", "message": "Before restructuring"}'

List revisions

GET /docs/:id/revisions

Response — 200: {"revisions": [...], "actors": {...}} — the actors map resolves each revision’s creating actor id to display metadata.

curl https://docs.aicomputercompany.com/api/docs/doc_abc123/revisions

Get a revision

GET /docs/:id/revisions/:revId        # → {"revision": {…}}
GET /docs/:id/revisions/:revId/raw    # → that revision's markdown, text/plain
curl https://docs.aicomputercompany.com/api/docs/doc_abc123/revisions/rev_xyz/raw

Revert

POST /docs/:id/revert

Body:

FieldTypeRequiredDescription
revisionIdstringyesThe revision (rev_…) to restore.

Response — 201: {"document": {…}, "revision": {…}}

Revert creates a new revision with the old content and diff-applies it to the live document — history is never rewritten, and collaborator cursors survive.

curl -X POST https://docs.aicomputercompany.com/api/docs/doc_abc123/revert \
  -H 'Content-Type: application/json' \
  -H 'x-actor-id: agent_demo' \
  -d '{"revisionId": "rev_xyz"}'