Ingestion API

POST /api/ingest validates normalized JSON traces, stores the raw payload, queues an ingest job, and returns immediately. The generated reference page for this flow is Queue trace ingestion.

Authentication

POST /api/ingest accepts either:
  • a bearer token from the CLI
  • a signed-in browser session

Contributor Terms

The account must have accepted the current Sell Traces Contributor Terms before it can upload. Until then the endpoint stores nothing and returns 403 with error: "terms_required" and an acceptUrl for the dashboard acceptance page. The selltraces CLI prints that URL, opens it in an interactive terminal, and exits non-zero; run the upload again after accepting.

JSON trace upload

JSON uploads can include up to 1,000 traces per request. Long traces are accepted; the server does not reject a trace because of its token count, message count, or per-message content length. The server recounts message tokens and ignores client-supplied token counts for payout-sensitive accounting.

Queued response

The HTTP status is 202.

Server processing

The background worker loads the raw JSON upload blob, then calls the ingest pipeline. The pipeline normalizes, scrubs, rejects high-risk PII, scores, deduplicates, inserts trace/message rows, and writes raw plus derived blobs.