Github
Reference

HTTP API

The routes a Handoff 2.1.0 server exposes, which credential each needs, and which ones are stable to call.

A running workspace and a registry serve the same documentation app with Next.js API routes. Most routes exist for the app itself, the CLI, or MCP. For programmatic access, prefer the MCP tools, the CLI, or the JavaScript API; the route shapes below are not a versioned public contract.

Credentials

CredentialHeader
Access token or device loginAuthorization: Bearer hnd_... or X-Handoff-Api-Key: hnd_...
HANDOFF_SYNC_SECRETSame headers
Browser sessionCookie set by sign-in

Mutating methods (POST, PUT, PATCH, DELETE) on registry routes need registry:write. Reads need registry:read. See Accounts and access.

Docs read API

GET only, no credential, in a workspace and in a registry. The documentation app reads through it.

RouteReturns
/api/docs/components.jsonEvery component
/api/docs/components/{id}.jsonOne component, with build state
/api/docs/components/{id}/previews/{previewId}A rendered preview
/api/docs/components/{id}/inspect/{previewId}A preview in inspect mode
/api/docs/components/{id}/assets/{asset}A built asset of the component
/api/docs/patterns.json, /api/docs/patterns/{id}.jsonPatterns
/api/docs/patterns/{id}/previewA rendered pattern
/api/docs/tokens/foundations/{type}.jsonFoundation tokens, for example colors
/api/docs/tokens/components/{id}.jsonComponent tokens
/api/docs/assets/{collection} and /{...path}Icon and logo collections, files, and zip archives
/api/docs/search/pages.json?q=&group=&limit=Ranked page search
/api/docs/nav.jsonNavigation

Registry only: /api/docs/components/{id}/custom-previews lists a component's custom previews, and .../{customId}/render serves one in its sandboxed render shell.

Registry API

Registry mode only. A workspace answers 409.

RouteMethodsPurpose
/api/registry/healthGETLiveness and transfer capabilities. No credential.
/api/registry/transfer/{component|pattern|page}GETList published entities
/api/registry/transfer/{kind}/{id}GET, PUTRead or publish one entity package
/api/registry/transfer/tokens, /tokens/{...setId}GET, PUTToken sets
/api/registry/transfer/assets, /assets/{collection}GET, PUTAsset collections
/api/registry/transfer/assets/blobs/havePOSTAsk which blob hashes the registry already has
/api/registry/transfer/assets/blobs/{hash}GET, PUTRead or upload a blob through the registry
/api/registry/transfer/assets/blobs/{hash}/upload, /completePOSTStart and finish a direct upload to storage
/api/registry/components, /patterns, /pagesGET, POST and per-id GET, PUT, DELETEEntity records and their files
/api/sync/uploadPOSTCompatibility route for older push clients

Other routes

RoutePurpose
/api/mcp/MCP endpoint
/api/ai/chat, /api/ai/connectionsAI assistant
/api/custom-previews, /api/custom-previews/{customId}Create (POST), change (PATCH), and delete (DELETE) custom previews, signed in
/api/oauth/device, /api/oauth/device/approve, /api/oauth/token, /api/oauth/revokeDevice-code login for the CLI
/api/auth/*, /api/account/*, /api/admin/users/*Sign-in, account settings, tokens, AI keys, and user management
/api/installThe first-administrator installer

A static site has no API routes.

On this page