Skip to content
sproutboatDocs
Esc
↑↓navigate↵open⌘Jpreview

Start a build

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
Authorization
AuthorizationBearer token · headerrequired

A team API key, sbk_..., from Settings, API keys.

or
x-api-keyAPI key · headerrequired

The same key, in a header of its own.

Path parameters
projectstringrequired

The app's name, unique within the team. 3 to 51 characters (or 1), lowercase letters, digits and dashes, not starting or ending with a dash.

matches ^[a-z0-9](?:[a-z0-9-]{1,49}[a-z0-9])?$
Request body
requiredapplication/json
source_sha256Sha256required
matches ^[0-9a-f]{64}$
kindstring
default: "generated"
Allowed:generated
buildobjectrequired
Show properties
vintegerrequired
namestringrequired

Must equal the project in the path.

cliobject

What produced the source: {version, runtime?, toolchain?}. Recorded and part of the cache key. Whole build object: at most 16 KiB.

specBuildSpec

The spec of a build request. Same as an app spec, without module, secrets and secrets_patch.

Show properties
activeboolean
default: true
hostsstring[]

The app's whole route list. Exclusive with hosts_patch.

max items 64
hosts_patchHostsPatch
Show properties
addstring[]
max items 64
removestring[]
max items 64
bindingsBinding[]
max items 64
Show properties
Array of Binding
namestringrequired
kindstringrequired
Allowed:kvd1r2queuedoaeratelimitassetssecretservice
resource_idstring | nullrequired
matches ^[a-z0-9][a-z0-9_-]{0,63}$
configobjectrequired

By kind: do {class_name} (the exported Durable Object class); ratelimit {limit, period}; queue {queue, retry_delay?}; service {} with the callee in the spec's services; the others {}.

servicesobject

Service bindings: binding name to the callee's app_id (from GET /v1/apps). Both apps must belong to the team and the callee cannot be the app itself. The runtime enables service bindings from compatibility date 2026-11-18 (CLI-enforced).

cronsstring[]
max items 16
queue_consumersQueueConsumer[]
max items 16
Show properties
Array of QueueConsumer
queuestringrequired
matches ^[a-z0-9][a-z0-9_-]{0,63}$
max_batch_sizeintegerrequired
min 1 · max 100
max_batch_timeout_msintegerrequired
min 0 · max 60000
max_retriesintegerrequired
min 0 · max 100
dead_letter_queuestring | nullrequired
limitsLimits

Per-app ceilings. A null or absent value means the platform default. The account's own ceilings (GET /v1/limits) cap what a team may ask for here: a value over one is refused with 403 quota-* (never clamped), and rate_rps: 0 (no limit) is refused too.

Show properties
memory_mbinteger | null
min 8 · max 4096
cpu_msinteger | null
min 10 · max 600000
wall_msinteger | null
min 100 · max 600000
storage_mbinteger | null
min 1 · max 1048576
rate_rpsinteger | null
min 0
rate_burstinteger | null

Needs rate_rps.

min 1
ops_per_secinteger | null
min 1
egress_bytes_per_dayinteger | null
min 0
egress_policy_refstring | null
assets_manifest_refstring | null

assets/<sha256 of the uploaded manifest>. The manifest must be uploaded first.

matches ^assets/[0-9a-f]{64}$
Responses
200

Answered from the cache, or an identical failed build refused again (state: failed, cached: true).

idstring<uuid>required
projectstringrequired
statestringrequired
Allowed:queuedbuildingreadyfailedcanceled
cachedboolean

True when the result came from an identical earlier build.

positioninteger | null

Place in the queue while queued.

waitingstring | null

Why a queued build is held back (for example waiting for memory). Not a failure.

supersededboolean

A newer deploy of the project overtook this build; it did not touch the app.

expected_sinteger | null

Estimated seconds to finish. An estimate, not a promise.

estimated_start_sinteger | null
errorobject | null

Set when failed or canceled. code is one of prepare_failed, prepare_timeout, compile_failed, compile_timeout, abi_rejected, input_invalid, timeout, resource_exceeded, canceled, builder_error, apply_failed, queue_timeout, builder_lost; message is the build output's reason.

Show properties
codestring
messagestring
module_sha256string | null

The module this build produced, once ready.

record_generationinteger | null

The app generation the build wrote, once ready. Wait for this to be applied.

hostsstring[]
created_byobject | null
Show properties
namestring
viastring | null
triggerstring

What started it: cli, git, dashboard or operator.

queued_atstring<date-time>
started_atstring<date-time> | null
finished_atstring<date-time> | null
statsobject
Show properties
wall_msinteger | null
cpu_msinteger | null
peak_memory_bytesinteger | null
memory_cap_bytesinteger | null
module_bytesinteger | null
202

Queued.

idstring<uuid>required
projectstringrequired
statestringrequired
Allowed:queuedbuildingreadyfailedcanceled
cachedboolean

True when the result came from an identical earlier build.

positioninteger | null

Place in the queue while queued.

waitingstring | null

Why a queued build is held back (for example waiting for memory). Not a failure.

supersededboolean

A newer deploy of the project overtook this build; it did not touch the app.

expected_sinteger | null

Estimated seconds to finish. An estimate, not a promise.

estimated_start_sinteger | null
errorobject | null

Set when failed or canceled. code is one of prepare_failed, prepare_timeout, compile_failed, compile_timeout, abi_rejected, input_invalid, timeout, resource_exceeded, canceled, builder_error, apply_failed, queue_timeout, builder_lost; message is the build output's reason.

Show properties
codestring
messagestring
module_sha256string | null

The module this build produced, once ready.

record_generationinteger | null

The app generation the build wrote, once ready. Wait for this to be applied.

hostsstring[]
created_byobject | null
Show properties
namestring
viastring | null
triggerstring

What started it: cli, git, dashboard or operator.

queued_atstring<date-time>
started_atstring<date-time> | null
finished_atstring<date-time> | null
statsobject
Show properties
wall_msinteger | null
cpu_msinteger | null
peak_memory_bytesinteger | null
memory_cap_bytesinteger | null
module_bytesinteger | null
400

The request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.

One of:
ErrorInvalid
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:invalid
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
401

No key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.

errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
403

The key lacks a grant (forbidden), a route is not the team's to use (host-not-yours), or the spec's limits are over the account's ceilings (quota-memory, quota-storage, quota-cpu, quota-wall, quota-rate, quota-ops).

One of:
ErrorForbidden
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:forbidden
needstringrequired

The grant, as <resource>:<action>, for example app:write.

ErrorHostNotYours
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:host-not-yours
pathstringrequired
Allowed:hosts
ErrorQuotaMemory
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-memory
limitintegerrequired

The ceiling, in MiB.

askedintegerrequired

What the spec asked for.

ErrorQuotaStorage
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-storage
limitintegerrequired

The ceiling, in MiB.

askedinteger

What limits.storage_mb asked for.

would_use_mbinteger

The static assets of the team's apps with this deploy, in MiB.

ErrorQuotaCpu
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-cpu
limitintegerrequired

The ceiling, in milliseconds of CPU per request.

askedintegerrequired
ErrorQuotaWall
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-wall
limitintegerrequired

The ceiling, in milliseconds of wall time per request.

askedintegerrequired
ErrorQuotaRate
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-rate
limitintegerrequired

The ceiling.

askedintegerrequired
ErrorQuotaOps
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-ops
limitintegerrequired

The ceiling, in binding operations per second.

askedintegerrequired
409

The source is not uploaded (source-missing), or another app holds a route (route-taken).

One of:
ErrorSourceMissing
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:source-missing
ErrorRouteTaken
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:route-taken
pathstringrequired
Allowed:hosts
413

The body is over the limit for this route (reason: too-large; some refusals carry a message only).

One of:
ErrorTooLarge
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:too-large
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
429

team-queue-full (3 builds already queued or running for the team), team-hourly-limit (20 builds in the last hour), queue-full (platform-wide queue), quota-builds (the free alpha builds per 24 hours) or key-rate-limited. Honor Retry-After.

One of:
ErrorKeyRateLimited
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:key-rate-limited
retry_after_sintegerrequired

Seconds to wait; also the Retry-After header.

ErrorTeamQueueFull
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:team-queue-full
ErrorTeamHourlyLimit
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:team-hourly-limit
ErrorQuotaBuilds
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-builds
limitintegerrequired
usedintegerrequired
retry_after_sintegerrequired

Until the next slot opens; also the Retry-After header.

ErrorQueueFull
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:queue-full
queue_lengthintegerrequired
drain_sintegerrequired

About how long the queue's work takes.

retry_after_sintegerrequired

About when a slot frees; also the Retry-After header.

503

Builds are not available right now: builds-disabled (this Cloud does not build) or no-builder (none is ready; retry in a few minutes).

One of:
ErrorBuildsDisabled
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:builds-disabled
ErrorNoBuilder
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:no-builder
Request
curl -X POST 'https://dash.sproutboat.com/v1/apps/my-app/builds' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "source_sha256": "string",
  "kind": "generated",
  "build": {
    "v": 1,
    "name": "string",
    "cli": {}
  },
  "spec": {
    "active": true,
    "hosts": [
      "string"
    ],
    "hosts_patch": {
      "add": [
        "string"
      ],
      "remove": [
        "string"
      ]
    },
    "bindings": [
      {
        "name": "string",
        "kind": "kv",
        "resource_id": "string",
        "config": {}
      }
    ],
    "services": {
      "property1": "string",
      "property2": "string"
    },
    "crons": [
      "string"
    ],
    "queue_consumers": [
      {
        "queue": "string",
        "max_batch_size": 1,
        "max_batch_timeout_ms": 0,
        "max_retries": 0,
        "dead_letter_queue": "string"
      }
    ],
    "limits": {
      "memory_mb": 8,
      "cpu_ms": 10,
      "wall_ms": 100,
      "storage_mb": 1,
      "rate_rps": 0,
      "rate_burst": 1,
      "ops_per_sec": 1,
      "egress_bytes_per_day": 0
    },
    "egress_policy_ref": "string",
    "assets_manifest_ref": "string"
  }
}'
Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "project": "string",
  "state": "queued",
  "cached": true,
  "position": 0,
  "waiting": "string",
  "superseded": true,
  "expected_s": 0,
  "estimated_start_s": 0,
  "error": {
    "code": "string",
    "message": "string"
  },
  "module_sha256": "string",
  "record_generation": 0,
  "hosts": [
    "string"
  ],
  "created_by": {
    "name": "string",
    "via": "string"
  },
  "trigger": "string",
  "queued_at": "2019-08-24T14:15:22Z",
  "started_at": "2019-08-24T14:15:22Z",
  "finished_at": "2019-08-24T14:15:22Z",
  "stats": {
    "wall_ms": 0,
    "cpu_ms": 0,
    "peak_memory_bytes": 0,
    "memory_cap_bytes": 0,
    "module_bytes": 0
  }
}