POST/v1/documents
Create or update a document by slug and create a new immutable version.
Headers:
Authorization: Bearer <token>
Idempotency-Key: pub_01HV7PS1YF6...
Request:
{
"slug": "q2-product-review",
"format": "html",
"content": "<main>...</main>",
"access": {
"visibility": "invite",
"commentPolicy": "authenticated"
}
}
Response 202:
{
"documentId": "doc_8xK",
"versionId": "ver_2BT",
"slug": "q2-product-review",
"state": "accepted",
"url": "https://app.example/@nate/q2-product-review"
}
GET/v1/documents/{documentId}/versions/{versionId}
Return version state, source hash, render artifact, and diagnostics.
Response 200:
{
"documentId": "doc_8xK",
"versionId": "ver_2BT",
"sourceHash": "sha256:3bb7...",
"rendererVersion": "renderer-html-2026.06",
"state": "ready",
"artifact": {
"url": "https://cdn.example/rendered/3bb7/renderer-html-2026.06.html",
"immutable": true
},
"traceId": "trc_01HV7Q..."
}
PATCH/v1/documents/{documentId}/access
Update projected access state independently from document content.
Request:
{
"visibility": "domain",
"allowedDomains": ["company.com"],
"commentPolicy": "authenticated"
}
Response 200:
{
"documentId": "doc_8xK",
"projectionVersion": 42,
"state": "projected"
}