# Constructor > Constructor is an agent-first visual builder for Next.js projects, layered on GitHub and Vercel. An agent builds from a prompt, saving a version is a git commit, and a release is a GitHub release deployed to Vercel. Everything the app does is an operation of one registry, and the REST API, the MCP server and the TypeScript SDK all expose that registry. ## Authenticate Send `Authorization: Bearer ` on every request. Two kinds of token work: - API key, `ck_live__`: created by a person in Account > API keys (https://www.useconstructor.com/app/account/api-keys) with a name, scopes, an optional project and an optional expiry. It is shown once and stored hashed. It acts as its owner within its scopes. - Agent delegation token, `cxd__`: granted for one project in Settings > Members > Agent access, or with the `delegations_create` tool by a key that holds `members:write`. It lasts at most 24 hours, carries a subset of scopes and can be revoked at once. Releasing to Production, managing secrets or members and deleting projects need a person. Delegation tokens never hold those scopes, and a refused call answers 403. Scopes: - `projects:read`: List and read projects, branches, members and views. - `projects:write`: Rename projects and change their description and favicon. - `builds:write`: Start builds, pause, resume, retry or cancel them. - `code:write`: Save the worktree as a commit on a branch. - `deploy:preview`: Publish a branch to a Preview deployment. - `deploy:production`: Release a version to Production. Connected agents never hold this scope. - `data:read`: Read the project database and its structure. - `data:write`: Change rows and database structure. - `settings:write`: Change project settings, domains, variables and integrations. - `members:write`: Invite or remove people and connect agents. - `secrets:write`: Create and change secret values. Connected agents never hold this scope. - `proposals:write`: Create change proposals and review them. - `proposals:merge`: Merge an approved proposal into its base branch. - `billing:read`: Read usage, budgets and invoices. - `plugins:execute`: Run only the plugin tools an owner has granted for this project and branch. ## Interfaces - REST: `https://www.useconstructor.com/api/v1`. 349 operations. Success is `{ "data": ... }`, failure is `{ "error": { "code", "message", "requestId", "reason"?, "branch"?, "tag"?, "fields"?, "retryAfterSec"? } }`. GET and DELETE read inputs from the query string (repeat a key for arrays), other methods take a JSON body, path parameters are in the path. - OpenAPI 3.1: https://www.useconstructor.com/api/v1/openapi.json - MCP: `POST https://www.useconstructor.com/api/mcp`, streamable HTTP, stateless, with the same bearer token. 262 tools named after the operation id with the dot replaced by an underscore (`projects_list`). `tools/list` shows only the tools your scopes allow and is paginated with `nextCursor`. Call `agent_access_whoami` to see your scopes and project. - SDK: `@constructor/sdk`. ```ts import { createConstructorClient } from "@constructor/sdk"; const client = createConstructorClient({ apiKey: process.env.CONSTRUCTOR_API_KEY ?? "", baseUrl: "https://www.useconstructor.com" }); const projects = await client.projects.list(); for await (const { event } of client.builds.events({ projectId, buildId })) console.log(event.type); ``` - Build progress: `GET https://www.useconstructor.com/api/builds/{buildId}/events` is a server-sent event stream. Resume with `?from=` or Last-Event-ID. The SDK does this for you. ## Errors - `unauthenticated`: HTTP 401 - `forbidden`: HTTP 403 - `not_found`: HTTP 404 - `invalid_input`: HTTP 422 - `conflict`: HTTP 409 - `precondition_failed`: HTTP 412 - `rate_limited`: HTTP 429 - `integration_unavailable`: HTTP 503 - `upstream_failed`: HTTP 502 - `budget_exceeded`: HTTP 402 - `internal`: HTTP 500 A 429 carries `retry-after` in seconds. A 503 `integration_unavailable` names the integration that is not connected and what still works. ## Start with these operations - `projects.list`: List projects. Projects you are a member of, most recently edited first. Archived projects are included only when includeArchived is true. GET /api/v1/projects. MCP tool `projects_list`. Scope `projects:read`. - `projects.create`: Create a project. Creates a project with its main branch and production and preview environments. With a prompt it also starts the first build; with a referenceUrl that build copies the linked page first, then makes the change the prompt asks for, and needs Vercel Sandbox and referenceAttestation "2026-10-27", the caller's confirmation of "I own this site or have permission to reproduce it", which is recorded with the build. POST /api/v1/projects. MCP tool `projects_create`. Scope `projects:write`. - `builds.start`: Start a build. Starts the agent on a prompt: plan, sections, logic, data, checks, commit and preview. Progress streams from /api/builds/{buildId}/events. A reference build (a referenceUrl) copies the linked page first and needs referenceAttestation "2026-10-27", the caller's confirmation of "I own this site or have permission to reproduce it", which is recorded with the build. POST /api/v1/projects/{projectId}/builds. MCP tool `builds_start`. Scope `builds:write`. - `git.save`: Save a version. Commits the branch's unsaved changes to GitHub as one commit. POST /api/v1/projects/{projectId}/git/save. MCP tool `git_save`. Scope `code:write`. - `deploy.publish_preview`: Publish a preview. Deploys the branch's last saved commit to a Vercel preview. With saveFirst it saves unsaved changes first. A person's publish first applies the commit's migrations the Preview database lacks, in order; one that is not only additive needs its hash in confirmChanges. POST /api/v1/projects/{projectId}/publish/preview. MCP tool `deploy_publish_preview`. Scope `deploy:preview`. ## Optional - Full operation list with inputs and outputs: https://www.useconstructor.com/api/v1/openapi.json