API Reference
All endpoints require Authorization: Bearer <token> except where noted. Base URL: https://api.samplec0de.ru.
POST /v1/ingest
Append a batch of structured log events. Supports application/x-ndjson and application/x-protobuf. Gzip-encoded bodies are auto-detected.
POST /v1/ingest HTTP/2
Content-Type: application/x-ndjson
Authorization: Bearer lg_tok_xxxxxxxx
Content-Encoding: gzip
{"ts":"2026-04-12T10:00:00Z","level":"info","msg":"user login","user_id":42}
{"ts":"2026-04-12T10:00:01Z","level":"warn","msg":"slow query","duration_ms":812}
Response: 202 Accepted with a JSON body containing batch_id and accepted_count.
GET /v1/events
Long-lived streaming connection that tails matching events. Returns application/x-ndjson line by line with HTTP/2 chunked framing. Supply filter= to limit by service or level.
GET /v1/events?filter=service=api&level=warn HTTP/2
Authorization: Bearer lg_tok_xxxxxxxx
POST /v1/query
Ad-hoc batch query against the last 24h. Returns results as NDJSON stream.
GET /status
Unauthenticated liveness/readiness probe. Returns {"status":"ok","uptime_s":...}.
Errors
400— malformed body401— missing or invalid token413— batch too large (max 8 MB)429— rate limited; Retry-After header set