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

Stream a running app's runs live, one per request

text/event-stream, the live counterpart of GET /v1/apps/{project}/invocations. Each data: line is one JSON object with a type:

  • ready, once, first.
  • invocation, with an invocation object (the same shape as in the list) when a run finishes. It carries the console lines and the error that came with it, matched by order. time is the host’s time when it finished. Lines no run claims within about 2 seconds arrive on their own as a system invocation. A request that runs longer than that can therefore show its early lines apart from it.
  • dropped, closed and the : keepalive comment: as in GET /v1/apps/{project}/tail. The viewer limits, the 10 minute session and the rate cap (100 invocations a second after the filters) are the same, and share the same slots.

GET /v1/apps/{project}/tail is unchanged: the Wrangler-shaped events sproutboat tail reads. Query strings and secret values are removed as in the list.

GET/v1/apps/{project}/invocations/tail
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])?$
Query parameters
statusstring[]

ok (the run was not an error), error (status_code is ERROR: an exception, a failed outcome, a 5xx, or a cron run that did not answer 2xx), a code such as 404 or a class such as 5xx (requests only). Repeat the parameter or comma-separate.

methodstring[]

HTTP methods (requests only), repeated or comma-separated.

handlerstring[]

Only these kinds of run: fetch, scheduled, trigger, system. Repeat or comma-separate. Default: all.

pathstring

A text the request path must contain (case-insensitive, at most 200 characters). Only requests have a path.

max length 200
searchstring

A text the method, path, a console line or an exception must contain (case-insensitive, at most 200 characters).

max length 200
levelstring

Only runs with a line or exception of at least this level. warn is 13 and up, error 17 and up. An exception counts as an error; a console line has a level only where the host recorded one (none yet), so today this finds runs with an exception.

Allowed:warnerror
Responses
200

The event stream.

string
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 (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

Too many live tails (tail-viewers, with the scope that is full and Retry-After), or key-rate-limited.

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.

ErrorTailViewers
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:tail-viewers
scopestringrequired

Which limit is full.

Allowed:appteamhostprocess
retry_afterintegerrequired

Seconds to wait; also the Retry-After header.

502

The host agent answered something the Cloud could not handle (reason: agent-error).

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:agent-error
503

The app's host is not reachable (host-unavailable), the app is not running on it yet (app-not-ready), or the audit log could not record the request (audit-unavailable). Retry shortly.

One of:
ErrorHostUnavailable
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:host-unavailable
ErrorAppNotReady
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:app-not-ready
ErrorAuditUnavailable
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:audit-unavailable
Request
curl -X GET 'https://dash.sproutboat.com/v1/apps/my-app/invocations/tail' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
"data: {\"type\":\"ready\"}\n\ndata: {\"type\":\"invocation\",\"invocation\":{\"id\":\"i0\",\"handler\":\"fetch\",\"time\":1795452909449,\"outcome\":\"ok\",\"status_code\":\"UNSET\",\"duration_ms\":12.3,\"cpu_ms\":null,\"attributes\":{\"http.request.method\":\"GET\",\"url.scheme\":\"https\",\"server.address\":\"blog.acme.sproutboat.app\",\"url.path\":\"/log\",\"http.response.status_code\":200,\"faas.trigger\":\"http\"},\"exceptions\":[],\"logs\":[{\"time\":1795452909448,\"severity_number\":0,\"body\":\"hello from the log route\",\"source\":\"app\"}],\"logs_matched_by\":\"order\",\"logs_dropped\":0}}\n"