docs.dev

Publish a page

POST
/api/admin/publish

Commits the page's MDX (and any uploaded assets) to the docs repository. GitHub sessions commit with the signed-in user's token, so the commit is attributed to them; PIN sessions use the server-held GITHUB_PAT. Assets land under public/uploads/ and are served at /uploads/….

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 POST "https://example.com/api/admin/publish" \  -H "Content-Type: application/json" \  -d '{    "slug": "getting-started",    "content": "string"  }'
{  "ok": true,  "commitUrl": "string"}
{  "ok": false,  "error": "string"}
{  "ok": false,  "error": "string"}
{  "ok": false,  "error": "string"}
{  "ok": false,  "error": "string"}