Ingest endpoint
POST /v1/events — append a batch of events to a project stream.
Request
| Header | Required | Notes |
|---|---|---|
Authorization | yes | Bearer <token> |
Content-Type | yes | application/x-ndjson or application/json for a single event |
Idempotency-Key | no | UUIDv4; deduplicates retries for 24 h |
Content-Encoding | no | gzip supported; decompressed size is what counts toward the 5 MB limit |
Event schema
| Field | Type | Description |
|---|---|---|
ts | RFC 3339 string | Event time, millisecond precision. Defaults to receive time when omitted. |
service | string | Emitting service, 1–64 characters, [a-z0-9._-]. |
event | string | Event name, dot-delimited, e.g. order.paid. |
props | object | Flat key/value payload, ≤ 8 KB serialized. |
trace_id | string | Optional 32-hex trace identifier for correlation. |
Responses
| Status | Code | Meaning |
|---|---|---|
| 202 | — | Batch accepted, possibly with per-event rejections. |
| 400 | malformed_batch | Body is not valid NDJSON. |
| 401 | invalid_token | Token missing, revoked, or expired. |
| 403 | region_mismatch | Token is not valid for this regional endpoint. |
| 413 | batch_too_large | Over 5 MB or 10,000 events. |
| 429 | quota_exceeded | Plan ceiling reached; retry after Retry-After. |
Partial success
A 202 does not guarantee every event was stored. Inspect rejected and the errors array:
{
"batch_id": "bt_01JGY4K2Q7",
"accepted": 9998,
"rejected": 2,
"errors": [
{"index": 41, "code": "schema_mismatch", "field": "props.cart_value", "detail": "expected number, got string"},
{"index": 773, "code": "timestamp_out_of_range", "detail": "ts is more than 30 days in the future"}
]
}
The
index is zero-based within the submitted batch. Re-submit only the failed events; accepted events are never rewritten.Compression
gzip typically reduces telemetry payloads by 8–12×. Enable it above roughly 16 KB per batch; below that the CPU cost usually outweighs the savings on the ingest side.