Server-side ingestion (HTTP)

For backend or non-browser events, POST directly to the ingestion endpoint with your write key in the x-traceiq-write-key header.

bash
curl -X POST https://api.traceiq.run/v1/events \
  -H 'content-type: application/json' \
  -H 'x-traceiq-write-key: YOUR_PROJECT_WRITE_KEY' \
  -d '{
    "projectId": "YOUR_PROJECT_ID",
    "userId": "user_123",
    "sessionId": "sess_1",
    "eventName": "purchase",
    "properties": { "amount": 49 },
    "timestamp": "2026-07-18T10:00:00.000Z"
  }'

Response:

json
{ "accepted": true, "eventId": "evt_..." }

To send many events in one request, POST to /v1/events/batch with a { projectId, batch: [...] } body (up to 500 events). Each event is validated independently — one bad event fails only itself. This is what @traceiq/node uses.