Noveum docs
Productsnoveum-traceConnect an applicationREST trace ingestion

Send Traces with the REST API

Ingest one trace or a batch directly from any language without installing noveum-trace.

Use REST ingestion when the application cannot use the Python package, including TypeScript services and custom telemetry pipelines. The REST API accepts the same trace and span structure used by the platform.

Use noveum-trace for supported Python applications. It manages context, parent relationships, batching, retries, and shutdown delivery for you.

Authentication

Send the organization API key as a bearer token:

Code
export NOVEUM_API_KEY="your-api-key"

Send one trace

Code
curl --request POST "https://api.noveum.ai/api/v1/traces/single" \
  --header "Authorization: Bearer $NOVEUM_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "trace_id": "5f9440c41d8a4e2c8a0cfd07c67df1d2",
    "name": "support-agent.request",
    "start_time": "2026-08-18T12:00:00.000Z",
    "end_time": "2026-08-18T12:00:00.850Z",
    "duration_ms": 850,
    "status": "ok",
    "span_count": 1,
    "error_count": 0,
    "project": "support-agent",
    "environment": "production",
    "service_version": "support-agent-v3",
    "sdk": {
      "name": "custom-typescript",
      "version": "1.0.0"
    },
    "metadata": {
      "user_id": "user-123",
      "session_id": "session-456",
      "request_id": "request-789"
    },
    "spans": [
      {
        "span_id": "c5c40b21540c4f78",
        "trace_id": "5f9440c41d8a4e2c8a0cfd07c67df1d2",
        "name": "llm.chat_completion",
        "start_time": "2026-08-18T12:00:00.050Z",
        "end_time": "2026-08-18T12:00:00.800Z",
        "duration_ms": 750,
        "status": "ok",
        "attributes": {
          "function.type": "llm_call",
          "llm.model": "gpt-4o-mini",
          "llm.provider": "openai",
          "llm.system_prompt": "Answer support questions from the supplied policy.",
          "llm.prompt": "Can I return this order?",
          "llm.completion": "Orders can be returned within 30 days.",
          "llm.usage.input_tokens": 82,
          "llm.usage.output_tokens": 11,
          "llm.usage.total_tokens": 93
        }
      }
    ]
  }'

Remove secrets and unnecessary personal data before ingestion, including from llm.system_prompt, llm.prompt, llm.completion, user_id, and session_id. When correlation is required, use approved pseudonymous identifiers instead of direct identifiers.

The API validates the complete payload before queueing it. A successful 200 response means the trace was accepted for asynchronous processing; it may take a short time to appear in Project Traces.

Required trace fields

FieldRequirement
nameStable name for the end-to-end request or execution.
start_time, end_timeISO 8601 timestamps or another accepted timestamp representation.
duration_msNon-negative end-to-end duration.
statusok, error, or timeout.
span_countNumber of spans in the spans array. For a trace sent in chunks, the total across all chunks.
projectProject name used to group the trace.
environmentEnvironment name; defaults to production when omitted.
sdkProducer name and version, even for a custom integration.
spansOrdered operation records belonging to the trace.

trace_id is optional on the trace envelope but required on each span. Generate it in the application and use the same value everywhere so parent relationships and retries remain stable.

Required span fields

Each span requires:

  • span_id and the enclosing trace_id
  • optional parent_span_id for nested work
  • operation name
  • start_time, end_time, and non-negative duration_ms
  • status of ok, error, or timeout
  • the application payload in attributes

For LLM, retrieval, and tool operations, follow the evaluation capture contract. The API stores arbitrary JSON attributes, but consistent names make filtering and ETL mapping reliable.

Send a batch

Send up to 1,000 traces to the batch endpoint:

Code
curl --request POST "https://api.noveum.ai/api/v1/traces" \
  --header "Authorization: Bearer $NOVEUM_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "traces": [
      {
        "trace_id": "5f9440c41d8a4e2c8a0cfd07c67df1d2",
        "name": "support-agent.request",
        "start_time": "2026-08-18T12:00:00.000Z",
        "end_time": "2026-08-18T12:00:00.850Z",
        "duration_ms": 850,
        "status": "ok",
        "span_count": 0,
        "error_count": 0,
        "project": "support-agent",
        "environment": "production",
        "service_version": "support-agent-v3",
        "sdk": {
          "name": "custom-typescript",
          "version": "1.0.0"
        },
        "spans": []
      }
    ]
  }'

Use bounded batches, retry rate-limited or server-error responses with backoff, and keep trace IDs stable across retries. Traces are immutable after ingestion. A successful response only acknowledges queueing; it does not report worker-side duplicates or storage failures. Verify delivery with GET /api/v1/traces/{trace_id} before treating the submission as complete.

Send a large trace in chunks

A request body can be at most 50 MiB. Send a trace that is larger, such as a long voice call, as several requests to POST /api/v1/traces/chunks, one chunk per request:

  • Every chunk carries the same trace fields: the same trace_id, name, timestamps, status, error_count, attributes and metadata. The trace is stored with the fields of the last chunk.
  • span_count is the total number of spans across all chunks, not the number in that request.
  • spans holds that chunk's share of the spans, at least one. Each span belongs to exactly one chunk.
  • chunk is { "index": i, "count": n }, where index starts at 0 and count is the number of chunks, at most 1,000. trace_id is required.
Code
curl --request POST "https://api.noveum.ai/api/v1/traces/chunks" \
  --header "Authorization: Bearer $NOVEUM_API_KEY" \
  --header "Content-Type: application/json" \
  --data @chunk-0.json

where chunk-0.json holds one trace:

Code
{
  "traces": [
    {
      "trace_id": "5f9440c41d8a4e2c8a0cfd07c67df1d2",
      "name": "voice-agent.call",
      "span_count": 4200,
      "chunk": { "index": 0, "count": 3 },
      "spans": [ "... the first 1,400 spans ..." ]
    }
  ]
}

The other trace fields are left out of the example for brevity. POST /api/v1/traces and /api/v1/traces/single reject a trace that has chunk.

Send the chunks in order, with the chunk where index is count - 1 last. The trace appears once its last chunk is stored. Realtime ETL and onboarding run once, after every chunk is stored. If an earlier chunk is still missing 30 minutes after the last chunk arrived, they run on the spans stored by then.

Resending a chunk with the same spans is safe and is not stored twice. Once the last chunk is stored, a chunk whose trace fields differ from it is rejected as a conflict. If the last chunk never arrives, the earlier chunks' spans are stored but the trace does not appear.

Verify ingestion

  1. Retrieve the trace by ID or open the configured project and environment in Project Traces.
  2. Filter by service_version and the time window from the payload.
  3. Open the trace and verify span ordering, status, duration, and attributes.
  4. Send a controlled error trace and confirm its status and error details are searchable.
  5. Continue to ETL setup only after representative payloads are complete.

Retry safely

  • Retry network failures, 429 responses, and 5xx responses with exponential backoff. Honor Retry-After when the response includes it.
  • Retry the exact same serialized trace data with the same trace_id and span_id values. Do not generate new identifiers for a retry; new IDs can create a second record instead of retrying the original operation.
  • Do not automatically retry 400, 401, 403, or 409. Fix the payload, credential, permission, or conflicting state first.
  • After receiving 200, wait for ingestion and verify the trace instead of resubmitting it merely because it is not visible yet.

Buffer traces when your application cannot reach Noveum, cap the buffer so it cannot exhaust local storage, and flush it in batches of no more than 1,000. Preserve the original timestamps and identifiers while buffered.