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

Stream a build's log

text/event-stream. Frames: state (state or queue position changed), log (a chunk of build output, id is its sequence number), done (once, the final build object; the stream then ends) and error. A : keepalive comment arrives every few seconds. Past logs are replayed from after, so to reconnect after a drop pass the last id you saw as after (or as Last-Event-ID). The stream is closed by the server after 20 minutes whatever the state: reconnect, or fall back to polling GET /v1/builds/{id}. The log of a build is kept to 256 KiB and ends with [log truncated at 256 KiB] beyond that.

GET/v1/builds/{id}/events
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).

Query parameters
afterinteger

Replay only log chunks with a larger sequence number. Default 0.

min 0 · default: 0
Header parameters
Last-Event-IDinteger

Used when after is absent.

min 0
Responses
200

The event stream.

string
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 GET 'https://dash.sproutboat.com/v1/builds/497f6eca-6276-4993-bfeb-53cbbbba6f08/events' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
"event: state\ndata: {\"state\":\"queued\",\"position\":1,\"waiting\":null,\"expected_s\":60,\"estimated_start_s\":0,\"starved\":false}\n\nid: 1\nevent: log\ndata: {\"text\":\"compiling...\\n\"}\n\nevent: done\ndata: {\"id\":\"...\",\"state\":\"ready\",\"record_generation\":7}\n"