1 · BugWatch — Ingest & Errors

POST/api/v1/bugwatch/browser-session

Mint browser session token

Mint a short-lived browser session token. Call this from your backend using the secret key — the token is then passed to your frontend. The secret never reaches the client.

Scope: ingest:write

Request

  • Method: POST
  • Header: x-api-key: {{apiKey}}
  • Body: empty

Success — 200 OK

{ "token": "<session-token>", "expiresAt": "2026-06-26T12:15:00.000Z" }

Common errors

  • 401 — invalid/missing x-api-key
  • 403 — key lacks ingest:write scope

Headers

x-api-key

Responses

200 – Token minted

{
  "token": "eyJhbGciOiJIUzI1NiJ9.example",
  "expiresAt": "2026-06-26T12:15:00.000Z"
}
boltTry it
env
POSThttp://localhost:5050/api/v1/bugwatch/browser-session

Headers

x-api-key

Request body

Code samples

curl -X POST 'http://localhost:5050/api/v1/bugwatch/browser-session'
POST/api/v1/bugwatch/ingest

Ingest – log event (JSON)

Ingest logs and error events from server-side or CI environments.

Scope: ingest:write

Request

  • Header: x-api-key: {{apiKey}}
  • Content-Type: application/json (single object or array) or application/x-ndjson (one event per line)
  • Max body: 2 MB

Event fields

FieldTypeNotes
levelnumber10/20/30/40/50/60
timenumberUnix ms timestamp
messagestringHuman-readable text
releasestringApp build version
environmentstringproduction / staging / development
eventIdstringOptional; enables deduplication within 10-min window
tagsobjectFlat key-value labels (≤50 keys)
userobject{id, email, username, ip} — only these four keys; others are silently dropped
traceIdstringHex distributed trace id (≤32 chars)
spanIdstringSpan id
exceptionobject{type, value, stacktrace: {frames}}
breadcrumbsarrayLeading events

Success — 202 Accepted

{ "ingested": 1, "skipped": 0, "deduped": 0 }

Headers

x-api-key

Request body

application/json
{
  "level": 30,
  "time": {{nowMs}},
  "message": "User signed in",
  "release": "1.0.0",
  "environment": "production",
  "tags": { "region": "eu-west-1" },
  "user": { "id": "usr_123", "email": "alice@example.com" }
}

Responses

Successful response

null
boltTry it
env
POSThttp://localhost:5050/api/v1/bugwatch/ingest

Headers

x-api-key

Request body

Code samples

curl -X POST 'http://localhost:5050/api/v1/bugwatch/ingest' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "level": 30,
  "time": {{nowMs}},
  "message": "User signed in",
  "release": "1.0.0",
  "environment": "production",
  "tags": { "region": "eu-west-1" },
  "user": { "id": "usr_123", "email": "alice@example.com" }
}'