INGEST API
Send events over the TrafficWar ingest API.
Use the HTTP API when no official SDK fits. Capture accepts one event object, batch accepts a bare event array, and both authenticate with a service API key.
JSON batch request
This is a sample payload, not a measurement. Replace its timestamp, duration, and status with the values you observed.
curl https://ingest.trafficwar.tech/v1/server/batch \
-H "Authorization: Bearer $TRAFFICWAR_API_KEY" \
-H "Content-Type: application/json" \
--data '[{
"event": "http",
"label": "GET /health",
"path": "/health",
"http_method": "GET",
"source": "backend-a",
"operation_type": "route.handler",
"span_kind": "server",
"timestamp": "2026-11-28T12:00:00Z",
"latency_ms": 3.4,
"status_code": 200
}]'Request behavior
- Content-Type may be application/json or application/msgpack.
- /capture accepts one event object; /batch accepts a bare array, not an object containing an events property.
- A request may contain at most 10,000 events.
- Plan quotas are hard all-or-nothing limits; a rejected batch is not partially charged.
- HTTP 200 is returned only after the ClickHouse insert succeeds.
Choose server or web routes deliberately
Trusted runtimes should use /v1/server/capture or /v1/server/batch. Browser routes are subject to the service CORS allowlist and should use credentials intended for that browser integration.
Register event and label pairs
POST /v1/server/catalog adds and deduplicates declarations for the service selected by the Bearer key, up to 4,000 stored declarations. Omitting a pair does not delete it. GET /v1/server/catalog reads the key’s catalog.
Node learns exact event/label pairs from valid captures accepted into its queue and sends only new pairs with station_known: false. There is no startup scan or inventory; Python does not register pairs. These declarations provide filter choices, not stations, traffic, or latency. Deleting a pair on the server does not clear a running Node client’s memory; a fresh client can register it again after observing it.
{"captures":[{"event":"http","label":"POST /v1/checkout","station_known":false}]}