Skip to content
v1
Docs

Ingest reference

Logs ingest

Send log lines with a log source’s token.

Its operations take the source's token as Authorization: Bearer <token>, never an API key.

Send log lines

POST/api/log-sources/ingest

Sends a batch of log lines with a log source’s token. The body is a JSON envelope {"lines": […]}, a JSON array, one line or newline-delimited JSON, any of them gzipped. Each line carries a message and optionally logged_at, log_level, stream_name and raw_line. An Idempotency-Key makes a retry of the same batch safe for 24 hours.

Limits (by default):

  • 1,000 lines in one request.
  • A body of 5,242,880 bytes as sent and 20,971,520 bytes after decompression.
  • A message of at most 65,536 bytes.
  • A logged_at more than 300 seconds ahead is clamped to now.
  • 600 requests a minute for each source.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same batch with the same key within 24 hours is answered as the first was, with the first batch’s batch_id and lines, and stored once. A different batch under a key used in the last 24 hours is refused with 422.

Body parameters

  • linesarray of objectsRequired

    The lines of the batch.

Returns

200 OK:

What was stored and how many lines the batch held.

The response panel's status selector shows each failure this operation can answer.