Subsystem

HTTP API: documents

The 7 operations tagged documents, each with its parameters, its body and what it answers.

List documents

GET /v1/documents

List the documents this caller can see.

Parameters

Responses

Write a document

POST /v1/documents

Create a document — a spec, a design, a note, a decision, a finding or a dead end.

Request body: Create as application/json, required.

Responses

Read one document

GET /v1/documents/{id_or_ref}

Return one document, by id or by ref.

Parameters

Responses

Change a document

PATCH /v1/documents/{id_or_ref}

Change a document. Omitted fields are untouched; nulls clear (docs/design.md §8.3).

Parameters

Request body: Update as application/json, required.

Responses

Move a document to the trash

DELETE /v1/documents/{id_or_ref}

Soft-delete a document. It stays recoverable (docs/design.md §6.9).

Parameters

Responses

Nest a document under another, or move it to the top level

POST /v1/documents/{id_or_ref}/move

Re-nest a document, taking its sections with it.

The half of re-parenting that had no endpoint at all. parent_id was reported by this view and accepted nowhere — not here, not on create, not on update — so a document could be a section of another only by being inserted into the database directly.

Parameters

Request body: Move as application/json, required.

Responses

Take a document out of the trash

POST /v1/documents/{id_or_ref}/restore

Restore a soft-deleted document — the task endpoint's counterpart (docs/design.md §6.9).

Both, because one ref counter serves both kinds (§6.2): a restore that worked on half the numbers would surprise anybody holding a ref.

Parameters

Responses