> ## 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.

# Publish a deployment

> Publish an app's latest successful build to make it live.

Publishes the app's latest **successful** build.

* **External** apps deploy to `https://<subdomain>.zite.so` (or a custom domain).
* **Internal** apps become available to your organization; `customSubdomain` is `null`.

<Warning>
  Publishing requires a **successful** build. If the latest build is still `building` or failed, the
  call returns a `400` explaining why — poll [`GET /apps/{appId}`](/build-api/workspaces/get-app) until
  `buildStatus` is `success`, or fix errors with [check](/build-api/sessions/check) / logs and
  [commit](/build-api/sessions/commit) again.
</Warning>


## OpenAPI

````yaml build-api/openapi.json POST /apps/{appId}/deployments
openapi: 3.0.1
info:
  title: Zite Build API
  description: >-
    Create, build, and deploy Zite apps programmatically — the REST equivalent
    of the Zite MCP build tools. Use it from a script, a CI pipeline, or your
    own agent.


    ## Authentication


    All requests require a Bearer API key from your Developer settings:

    ```

    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.


    ## Base URL


    https://api.zite.com/v1


    ## Errors


    Errors return `{ "statusCode": 404, "error": "Not Found", "message":
    "Workspace not found" }`. Notable statuses: `401` (bad or missing key),
    `402` (the build tools aren't in your plan), `404`, `409` (a commit push
    conflict — pull, rebase, and commit again), and `400` for validation
    failures and publishing before a build is green.
  version: 1.0.0
servers:
  - url: https://api.zite.com/v1
    description: Zite Build API
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Create workspaces and inspect the apps in them.
  - name: Build sessions
    description: >-
      Open an isolated checkout of a workspace, create apps, edit files, check,
      and commit.
  - name: Deployments
    description: Publish built apps, manage versions, roll back, and read runtime logs.
paths:
  /apps/{appId}/deployments:
    post:
      tags:
        - Deployments
      summary: Publish a deployment
      description: >-
        Publishes the app's latest successful build. External apps deploy to
        `https://<subdomain>.zite.so` (or a custom domain); internal apps become
        available to your organization and `liveUrl` is `null`. Publishing
        requires a successful build — if the latest build is still `building` or
        `failed`, the call returns `BUILD_NOT_READY`.
      operationId: publishDeployment
      parameters:
        - $ref: '#/components/parameters/AppId'
      responses:
        '201':
          description: The live deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
              example:
                id: dep_5f7c2a
                status: live
                accessMode: external
                liveUrl: https://agent-console.zite.so
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/BuildNotReady'
components:
  parameters:
    AppId:
      name: appId
      in: path
      required: true
      description: The app ID.
      schema:
        type: string
      example: app_a1b2c3
  schemas:
    Deployment:
      type: object
      properties:
        published:
          type: boolean
          example: true
        snapshotId:
          type: integer
          description: The build snapshot that is now live.
        accessMode:
          $ref: '#/components/schemas/AccessMode'
        customSubdomain:
          type: string
          nullable: true
          description: For `external` apps, the `<subdomain>.zite.so` host serving the app.
          example: agent-console
        publicIdentifier:
          type: string
          example: app_a1b2c3
        workspaceId:
          type: string
          nullable: true
          example: wsp8bce4d1edc51710
    AccessMode:
      type: string
      enum:
        - internal
        - external
      default: internal
      description: >-
        `internal` apps are available to your organization; `external` apps
        deploy to a public subdomain.
    Error:
      type: object
      properties:
        statusCode:
          type: integer
          example: 404
        error:
          type: string
          example: Not Found
        message:
          type: string
          example: Workspace not found
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHORIZED
              message: Missing or invalid API key.
    NotFound:
      description: The resource does not exist or your key cannot access it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: NOT_FOUND
              message: Workspace not found.
    BuildNotReady:
      description: Publishing before the latest build is green.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: BUILD_NOT_READY
              message: >-
                The latest build is still building. Poll GET /apps/{appId} until
                buildStatus is success.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Enter your Zite API key. Format: Bearer <api_key>'

````