API Reference
The API behind the in-site editor — sessions, shared drafts, publishing, and AI generation.
Everything the docs.dev editor does — signing in, autosaving shared drafts, publishing to GitHub, generating content with AI — goes through this same-origin API, documented here from its OpenAPI schema. Each endpoint page includes an interactive playground.
Auth
Sign in with a PIN or GitHub, inspect the session, sign out.
Sign in with a PIN
Exchanges the team PIN for a sealed session cookie.
Sign in with GitHub
Starts the GitHub App OAuth flow.
Inspect the current session
Sign out
Clears the session cookie.
Drafts
Shared drafts visible to every editor, with a last-writer conflict guard.
Read a draft, or list all drafts
With slug, returns that page's shared draft (or null).
Delete a draft
Save a draft
Saves the shared draft for a page.
Pages
List and delete documentation pages.
List published pages
Slugs of every built documentation page.
Delete a page
Clears the page's shared draft, and — if the page is published — commits the removal of its MDX file to GitHub.
Publish
Commit a page (and its uploaded assets) to GitHub.
AI
Workers AI documentation writing and image generation.