Docs/Api Reference/Ingest Api

Ingest API (DSN)

The ingest API is the public endpoint that receives error events, transactions, logs, and session replays from your SDKs.

Endpoint

POST https://app.unseenr.io/api/{projectId}/envelope

Where {projectId} is your project's numeric ID or CUID.

Authentication

Authentication is done via the public key from your DSN. The key can be provided in three ways:

  1. Query parameter: ?sentry_key=<PUBLIC_KEY>
  2. x-unseenr-auth header: x-unseenr-auth: sentry_key=<PUBLIC_KEY>
  3. x-sentry-auth header: x-sentry-auth: sentry_key=<PUBLIC_KEY> (Sentry SDK compatible)

Request Format

The body uses Sentry's envelope format: a newline-separated sequence of JSON headers and payloads.

{"event_id":"...","dsn":"..."}
{"type":"event","length":...}
{"exception":{"values":[...]},"event_id":"...","timestamp":...}

Supported Envelope Types

Type Description
event Error events (exceptions, messages)
transaction Performance transactions with spans
log Structured log entries
replay_event Session replay metadata
replay_recording Session replay recording data (gzip)

Response

Success (200)

{
  "id": "32-character-event-id"
}

Response Headers

Header Description
X-Unseenr-Usage {current}/{quota} e.g., 4821/5000
X-Unseenr-Usage-Percent Usage percentage as integer
X-Unseenr-Quota-Warning true when usage exceeds 75%
X-RateLimit-Remaining Remaining requests in current window
X-RateLimit-Reset Timestamp when rate limit resets

Error Responses

Status Body Cause
401 {"error":"Missing authentication"} No public key provided
401 {"error":"Invalid project or key"} Wrong project ID or public key
413 {"error":"Payload too large"} Body exceeds 5 MB
429 {"error":"Rate limit exceeded"} Per-minute rate limit hit
429 {"error":"quota_exceeded"} Monthly quota exceeded and overage disabled
400 {"error":"Invalid envelope format"} Unparseable envelope
500 {"error":"Internal server error","errorId":"..."} Server error (errorId for support)

CORS

The ingest endpoint has permissive CORS headers for browser SDKs. Null origin is allowed for server-side SDKs.

Request Size Limit

The maximum request body size is 5 MB. Larger payloads are rejected with HTTP 413.

Processing Pipeline

  1. Authentication: Validate public key against project
  2. Rate limiting: Check per-minute rate limit (before quota)
  3. Inbound filters: Apply browser extension, localhost, crawler, and origin filters (before quota)
  4. Quota check: Atomic Redis increment with TTL
  5. Queue: Add to BullMQ for async processing by the worker
  6. Response: Return event ID immediately

Events are billed at the point of HTTP acceptance (step 4), not after async processing. This is the industry standard (identical to Sentry, Datadog, PostHog).

Also available in:Deutsch