DS Draftlane Studio
Service documentation

Draftlane Control API

Draftlane exposes a versioned control-plane API for agent-driven project creation, generation orchestration, workspace inspection, and generated file discovery.

Authentication

Use the existing Clerk session cookie on the app domain for first-party requests.

Use a bearer token from a Clerk session for programmatic user-scoped access.

Use X-Draftlane-Agent-Key with X-Draftlane-External-User-Id for white-label server-to-server automation.

Key endpoints

GET /api/v1

GET /api/v1/health

GET /api/v1/workspace

GET /api/v1/projects

POST /api/v1/projects

GET /api/v1/projects/{projectId}

GET /api/v1/projects/{projectId}/files

GET /api/v1/projects/{projectId}/files?format=zip

GET /api/v1/projects/{projectId}/generation

POST /api/v1/projects/{projectId}/generation

GET /api/v1/projects/{projectId}/generations

GET /api/v1/projects/{projectId}/generation/{generationId}/agent-session

GET /api/v1/workspace/billing-events

GET /api/v1/workspace/subscription

The files endpoint returns JSON by default and streams a downloadable zip archive when format=zip is present or the request sends Accept: application/zip. Completed generation records include revision and readiness metadata for preview, repair, and publish decisions. Auto-publish and downstream Vercel deployments are gated by build readiness: blocked generations skip automatic publish, review generations proceed with a warning. The generations list endpoint returns the full history for a project, including revision fingerprints for diffing and a rollback path to restore a previous working state. The generation endpoint currently runs a local multi-turn agent loop, not Anthropic Managed Agents, and the agent-session endpoint exposes the latest turn snapshot for support and debugging. Workspace billing events and subscription endpoints are now part of the same control surface for support-safe billing visibility. The entire /api/v1 surface is fixed-window rate limited and returns 429 when callers exceed the configured request budget.

Discovery documents

/.well-known/api-catalog

/.well-known/openid-configuration

/.well-known/oauth-authorization-server

/.well-known/oauth-protected-resource

/.well-known/agent-card.json

/.well-known/mcp/server-card.json

/.well-known/agent-skills/index.json