> ## Documentation Index
> Fetch the complete documentation index at: https://developers.zite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build API

> Create, build, and deploy Zite apps programmatically, from your own code, CI, or your own agent. The REST equivalent of the Zite MCP build tools.

## Base URL and auth

```text theme={"system"}
https://api.zite.com/v1
```

Authenticate with a Bearer API key from your
[Developer settings](https://app.zite.com/home/settings/developer):

```bash theme={"system"}
Authorization: Bearer <your-api-key>
```

The key acts as **you**, so it can only see and change workspaces you have access to, and every change is
attributed to you in the app's [version history](/deploy/publishing).

<Note>
  The build endpoints are free for 7 days, starting on your first build call. After that they're on the
  Business plan and above, and an unentitled key gets a `402`.
</Note>

## The lifecycle

<Steps>
  <Step title="Create a workspace">
    A database plus the apps built on it. See [Create a workspace](/build-api/workspaces/create-workspace).
  </Step>

  <Step title="Open a build session">
    An isolated checkout where you create apps and edit files. See [Open a session](/build-api/sessions/open-session).
  </Step>

  <Step title="Create an app and write code">
    Scaffold, edit, check, iterate. See [Create an app](/build-api/sessions/create-app).
  </Step>

  <Step title="Commit">
    Builds a versioned snapshot in the background. See [Commit](/build-api/sessions/commit).
  </Step>

  <Step title="Deploy and observe">
    Publish the build live and pull logs. See [Publish a deployment](/build-api/deployments/publish-deployment).
  </Step>
</Steps>

## Relationship to the Zite MCP

Same operations and semantics as the [Zite MCP build tools](/mcp/build-tools), where a session maps to a
sandbox. Use the MCP for interactive agents, the Build API for CI, scripts, and automation.

## Conventions

### Errors

Every error returns the same envelope:

```json theme={"system"}
{ "statusCode": 404, "error": "Not Found", "message": "App not found" }
```

| Status | Meaning |
| - | - |
| `401` | Invalid or missing API key |
| `402` | The build tools aren't active: the free trial has ended, or your plan doesn't include them |
| `404` | Resource doesn't exist |
| `409` | The workspace has newer commits than your session. Pull and rebase inside the session, then commit again |
| `400` | Invalid request data, or publishing while the latest build was still `building` or had failed |

### Async builds

<Warning>
  `commit` and publish kick off builds in the background. Poll the app's `buildStatus` (see
  [Get an app](/build-api/workspaces/get-app)) and wait for a green build before publishing.
  Publishing early returns a `400` explaining why.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.