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

Cancel a build

A queued build becomes canceled at once; a running one is asked to stop and ends as canceled shortly. A build that already finished is returned unchanged (so this is safe to call after the fact).

DELETE/v1/builds/{id}
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
idstring<uuid>required

A build id (a UUID, from POST /v1/apps/{project}/builds).

Responses
200

The build after the request.

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
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 (reason: forbidden, need: "<resource>:<action>").

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:forbidden
needstringrequired

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

404

No such app, build, secret, manifest or claim in this team (another team's resource looks the same).

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

The key is over its requests a minute (600, or 2,000 with app:write; reason: key-rate-limited, retry_after_s, Retry-After). Wait that long and retry.

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.

Request
curl -X DELETE 'https://dash.sproutboat.com/v1/builds/497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -H 'Authorization: Bearer YOUR_TOKEN'
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
  }
}