Skip to main content
POST
Ingest trace events

Authorizations

x-api-key
string
header
required

Project API key. Manage keys in the Zespan dashboard under project settings.

Headers

Idempotency-Key
string

Optional key identifying this batch. Repeating an accepted request with the same key and body returns the original result with replayed: true and the Idempotent-Replayed: true header, and nothing is queued or counted again.

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9._:-]{1,128}$

Body

application/x-ndjson

Newline-delimited JSON. Each line is a single event object.

Example:

"{\"trace_id\":\"3b1c...\",\"span_id\":\"a91f...\",\"name\":\"chat.completions\",\"provider\":\"openai\",\"model\":\"gpt-4o\",\"operation\":\"chat.completions\",\"input_tokens\":812,\"output_tokens\":146,\"latency_ms\":1240,\"status\":\"success\",\"timestamp\":\"2026-07-05T12:00:00.000Z\"}\n{\"trace_id\":\"3b1c...\",\"span_id\":\"c72d...\",\"parent_span_id\":\"a91f...\",\"name\":\"vector.search\",\"operation\":\"retrieval.query\",\"latency_ms\":54,\"status\":\"success\",\"timestamp\":\"2026-07-05T12:00:00.050Z\"}\n"

Response

Batch accepted for asynchronous processing.

accepted
integer
required

Number of events accepted from the batch.

Example:

2

cv
integer
required

Current project config version (used by SDKs for config propagation).

Example:

7

replayed
boolean

Present and true when this response replays an earlier accepted request with the same Idempotency-Key.

Example:

true