> ## 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={null}
https://api.zite.com/v1
```

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

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

The key acts as **you** — 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).

## 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 [Build MCP tools](/mcp/build-tools) (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={null}
{ "statusCode": 404, "error": "Not Found", "message": "App not found" }
```

| Status | Meaning                                                                                                   |
| ------ | --------------------------------------------------------------------------------------------------------- |
| `401`  | Invalid or missing API key                                                                                |
| `402`  | The build tools aren't included in your organization's plan                                               |
| `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>
