docs.dev

Read a draft, or list all drafts

GET
/api/admin/drafts

With slug, returns that page's shared draft (or null). Without it, lists every draft's metadata — used for the DRAFT dots in the sidebar.

docsdev_admin<token>

Sealed (AES-256-GCM) session cookie issued by POST /api/admin/login or the GitHub OAuth callback.

In: cookie

Query Parameters

slug?string

Page slug. Omit to list all drafts.

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/admin/drafts"
{  "ok": true,  "draft": {    "slug": "getting-started",    "content": "string",    "updatedAt": 1783106203671,    "author": "Sarah Chen"  },  "drafts": [    {      "slug": "string",      "updatedAt": 0,      "author": "string"    }  ]}
{  "ok": false,  "error": "string"}
{  "ok": false,  "error": "string"}