Skip to content

Ingest JSON logs

You will learn how to send events with a stream API key using native HTTP JSON.

Endpoint

POST /v1/streams/{stream_id}/ingest
Content-Type: application/json
X-API-Key: lax_<prefix>_<secret>

Body: a single JSON object, or a JSON array of objects. Max body size 1 MiB. Success: 202 Accepted with { "accepted": N, "stream_id": "…" }.

Session JWTs cannot ingest — use a stream API key.

Create a key

Follow Manage stream API keys. Copy the secret once and prefer the UI curl sample when shown.

curl — single event

export CORDO_API=https://api.cordo.cloud
export STREAM_ID=<stream-uuid>
export KEY=lax_<prefix>_<secret>

curl -sS -X POST "$CORDO_API/v1/streams/$STREAM_ID/ingest" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $KEY" \
  -d '{"level":"info","service":"api","msg":"hello from curl"}'

curl — batch

curl -sS -X POST "$CORDO_API/v1/streams/$STREAM_ID/ingest" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $KEY" \
  -d '[{"level":"info","msg":"a"},{"level":"warn","msg":"b"}]'

Verify

  1. Open Events for the selected stream.
  2. Open Fields after a short wait for learned paths.
  3. Run a Query filter such as level = info.

Next