API ReferenceDrafts
Save a draft
Saves the shared draft for a page. Carries the updatedAt you based your edit on; if a teammate saved since, the write is rejected with 409 and their draft, so the editor can offer Load theirs / Keep mine instead of silently clobbering. For GitHub sessions the author is taken from the verified identity — a client-supplied author is ignored.
Authorization
session docsdev_admin<token>
Sealed (AES-256-GCM) session cookie issued by POST /api/admin/login or the GitHub OAuth callback.
In: cookie
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/api/admin/drafts" \ -H "Content-Type: application/json" \ -d '{ "slug": "getting-started", "content": "string" }'{ "ok": true, "updatedAt": 0}{ "ok": false, "error": "string"}{ "ok": false, "error": "string"}{ "ok": false, "conflict": { "slug": "getting-started", "content": "string", "updatedAt": 1783106203671, "author": "Sarah Chen" }}{ "ok": false, "error": "string"}