Skip to main content
POST /api/v1/query
Body
FieldTypeRequiredNotes
org_idstringTenant id (from login).
languagestringsql or promql.
statementstringQuery text.
time_rangeobject{ "start": <us>, "end": <us> } — microseconds.
streamobject{ "name", "stream_type" }; stream_typelogs/metrics/traces/enrichment.
limitintegerRow cap.
Send Accept: application/x-ndjson to stream the result (bypasses the query_result cache).
curl -X POST http://localhost:5080/api/v1/query \
  -H "authorization: Bearer $MS_JWT" \
  -H 'content-type: application/json' \
  -d "{\"org_id\":\"$MS_ORG\",\"language\":\"sql\",
       \"statement\":\"SELECT level, count(*) FROM app GROUP BY level\",
       \"time_range\":{\"start\":0,\"end\":2000000000000000},
       \"stream\":{\"name\":\"app\",\"stream_type\":\"logs\"}}"
{
  "rows": [{ "level": "error", "count": 12 }],
  "columns": ["level", "count"],
  "scanned_rows": 10432,
  "took_ms": 18,
  "cache_hit": false
}