Server Ingest API

Server-side event and error ingest for BugWatch. Uses x-api-key with ingest:write scope. Also includes the browser-session mint endpoint (called server-side to produce a token for the browser).

Scope required: ingest:write

Event severity scale trace=10 · debug=20 · info=30 · warn=40 · error=50 · fatal=60


Event payload contract

FieldTypeNotes
levelnumberstring
timenumberEpoch milliseconds - optional; server stamps now if omitted
messagestringHuman-readable description
releasestring ≤200Build/version label - informational in the body; the real environment binding comes from your API key
environmentstringInformational only; the actual environment is bound to the API key
eventIdstringOptional; enables deduplication within a 10-minute window
traceIdhex string ≤32Distributed trace id
spanIdhex string ≤16Span id
tagsflat objectScalar string values only; max 50 keys
userobjectAccepted keys: id, email, username, ip - any other key is silently dropped
exceptionobject{type, value, stacktrace: {frames: [{filename, function, lineno, colno}]}}
breadcrumbsarrayLeading context events
contextobjectArbitrary structured data - passed through and redacted
fingerprintstring or string[]Optional grouping override (controls how events group into issues)

Producing this from your app: user (global vs concurrency-safe per-request vs per-capture), tags, release, context and trace IDs are set through the BugWatch SDKs - see SDK Usage & Event Enrichment. On the wire each event carries a single merged user object; there is no separate per-request-user field.

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
POSThttps://api.newinstance.cloud/api/v1/bugwatch/browser-session

Headers

x-api-key

Request body

Code samples

curl -X POST 'https://api.newinstance.cloud/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
POSThttps://api.newinstance.cloud/api/v1/bugwatch/ingest

Headers

x-api-key

Request body

Code samples

curl -X POST 'https://api.newinstance.cloud/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" }
}'