Undraft Developers and Agent API
Undraft provides a public REST API and an official CLI for publishing AI-generated web projects. The hosted API base URL is https://undraft.page/api/v1. Authenticated operations use an API key in the Authorization: Bearer undraft_<key> header. Create and revoke keys in Dashboard → API keys, or complete the CLI device login flow. Never embed a private key in browser code or a public repository.
When to use the API
Use Undraft programmatically when an agent, build pipeline, or local tool needs to publish HTML or a ZIP archive, create a new project, push a version to an existing project, list projects, inspect project metadata, or delete an owned project. Use the public capabilities endpoint first when you only need to discover the API without authenticating.
Quick start
curl https://undraft.page/api/v1/status
npx undraft login
npx undraft publish ./dist
For direct HTTP integration, send a multipart request to POST /api/v1/projects with either a file or html field. Successful requests return a project URL, slug, project ID, version ID, version number, and entry point. Supply an Idempotency-Key header when a request may be retried.
Machine-readable resources: OpenAPI JSON, OpenAPI YAML, llms.txt, agent instructions, and sitemap. The official CLI is published on npm as undraft.