Skip to content

Artifacts API reference

GET /v1/artifacts/*: the bytes behind a workflow block’s screenshotKey, org-checked, with content type and digest headers, until the retention window ends.

Last updated:

GET /v1/artifacts/*

Serves a stored artifact by its key, as bytes. The key comes from a workflow run’s `blocks[].screenshotKey`.

Response headers

A key from another organisation, an expired artifact and a malformed key all answer `not_found`; nothing distinguishes them, on purpose.

Name Type Description
Content-Type header The artifact’s type, `image/png` for screenshots.
X-Browserberg-Digest header `sha256=<hex>` of the bytes — the same digest the audit entry recorded for the block, so a picture can be bound to a log line.
Cache-Control header `private, no-store`.

Fetch a run’s screenshot

BASE="https://browserberg.com"
AUTH="Authorization: Bearer $BROWSERBERG_API_KEY"

# The newest workflow run with a screenshot; the guide-workflow-run snippet created one.
KEY=$(curl -s "$BASE/v1/workflow-runs?limit=20" -H "$AUTH" \
  | python3 -c 'import json,sys; runs=json.load(sys.stdin)["runs"]; keys=[b["screenshotKey"] for r in runs for b in r["blocks"] if b.get("screenshotKey")]; print(keys[0] if keys else "")')

if [ -z "$KEY" ]; then echo "no screenshot yet"; exit 0; fi

curl -s "$BASE/v1/artifacts/$KEY" -H "$AUTH" -D /tmp/artifact-headers -o /tmp/artifact.bin
grep -i '^content-type' /tmp/artifact-headers | tr -d '\r'
grep -i '^x-browserberg-digest' /tmp/artifact-headers | cut -c1-30 | tr -d '\r'
echo "bytes: $(wc -c < /tmp/artifact.bin | tr -d ' ')"

Note · Retention

Artifacts expire with the retention window, 72 hours by default. A run keeps its `screenshotKey` after that; the fetch answers `not_found`.