---
search:
  tags:
    - Builds
    - POST
seo:
  description: >-
    Validates the request, then either answers from the cache (HTTP 200, a…
    Reference for the POST /v1/apps/{project}/builds endpoint in the Sproutboat
    Cloud API.
sidebar:
  label: Start a build
  badge: POST
title: Start a build
type: openapi-operation
---
Validates the request, then either answers from the cache (HTTP 200, a `ready` build with `cached: true`) or
queues a build (HTTP 202, `state: queued`). When the build finishes the Cloud writes the app with the new
module and `spec`, and sets `record_generation` on the build; a host then applies it (see `GET /v1/apps/{project}`).
A newer build of the same project cancels an older queued one.

`spec` takes the same keys as `PUT /v1/apps/{project}` **except** `module`, `secrets` and `secrets_patch`
(400 `invalid`, `path: spec.<key>`): it is stored in plain text, so set secrets with `PATCH
/v1/apps/{project}/secrets` after the build is `ready`. Use `hosts_patch` rather than `hosts` to leave an app's
other routes alone. Route ownership and conflicts are checked up front, and again when the build lands, and so are
the `limits` the spec asks for against the account's ceilings (403 `quota-*`, as for `PUT /v1/apps/{project}`).
The source must be one this team uploaded (a digest another team holds is 409 `source-missing`). The build quota
is 429 `quota-builds`.

`build` is `{"v": 1, "name": "<project>", "cli": {"version": "...", "runtime": "...", "toolchain": "..."}}`;
`name` must equal the project. `kind` must be `generated` (the only kind that exists). The source must already
be uploaded (409 `source-missing`).

`POST /v1/apps/{project}/builds`
