ZevSight
Open app

API reference

Query API reference

Reference for log search, context, histogram, facets and patterns on the regional query API, generated from the ZevSight OpenAPI file.

Search events with an engine ticket, read key or agent key.

Read endpoints for logs. Use an API key (zsr_…) with read or respond permission. The q parameter uses the search syntax.

Base URL: https://eu.zevsight.com. Machine-readable: /openapi.yaml.

Search events

GET https://eu.zevsight.com/v1/query/logs

Search events, newest first, with cursor paging.

Authentication: Authorization: Bearer <token> with dashboard session, or API key (zsr_…), or legacy agent key (zsa_…).

Parameters

NameInTypeRequiredDescription
projectquerystringyesOne or more project public ids, comma-separated, or all (every project the caller may read in this region). Each named project must be readable by the caller.
fromquerystring (date-time)yes
toquerystring (date-time)Defaults to now.
envquerystringEnvironments to include, comma-separated (the same as env: terms joined by OR).
qquerystringFilter expression. Grammar (draft): service:api env:production level:>=warn "connection reset" attrs.route:/v1/* -attrs.user_id:42 trace:4bf9… Bare words and quoted phrases match the message as tokens. A comma inside a field term means OR: service:auth,api, env:production,staging, level:error,fatal (exact levels only, not with >= or <=), type:log,heartbeat, attrs.route:/v1/pay,/v1/cart (a value with * is a wildcard, OR’d with the rest). A leading - negates the whole list (-service:auth,api = neither). \, is a literal comma and \\ a literal backslash. At most 50 values per term. Up to 2000 characters.
limitqueryintegerDefault 200. 1 to 1000.
cursorquerystringOpaque; from next_cursor of the previous page.

Responses

StatusDescription
200A page of events.
400The request, or every event in it, is invalid.
401Missing, unknown, expired or wrong-kind credential.
404No such object, or not visible to this credential (never 403 across tenants).
421The credential belongs to another data region. Nothing was stored or forwarded; endpoint names the right host.
429Burst limit (RATE_LIMITED) or monthly quota (QUOTA_EXCEEDED). Headers: Retry-After.
503The queue is unavailable or full. Nothing was stored; retry. Headers: Retry-After.

Response fields (200):

FieldTypeRequiredDescription
eventsarray of EventOutyes
events[].idstring (uuid)yesUUIDv7. Omit to have one generated.
events[].environmentstringyesDefault production. Pattern ^[a-z0-9][a-z0-9._-]{0,63}$.
events[].servicestringyesDefault unknown. Pattern ^[a-z0-9][a-z0-9._-]{0,63}$.
events[].typestringyesOne of log, heartbeat, check_result.
events[].tsstring (date-time)yes
events[].trace_idstringPattern ^[0-9a-f]{32}$.
events[].span_idstringPattern ^[0-9a-f]{16}$.
events[].severitystringOne of trace, debug, info, warn, error, fatal.
events[].attrsobjectUp to 128 keys. Map of string to string (values up to 8192 characters).
events[].resourceobjectUp to 128 keys. Map of string to string (values up to 8192 characters).
events[].bodyone of LogBody, HeartbeatBody, CheckResultBodyyes
events[].body.messagestringyes(LogBody) Truncated above 64 KiB.
events[].body.fieldsobject(LogBody)
events[].body.monitor_idstringyes(HeartbeatBody)
events[].body.statusstringyes(HeartbeatBody) One of start, ok, fail.
events[].body.duration_msinteger(HeartbeatBody) At least 0.
events[].body.notestring(HeartbeatBody) Up to 8192 characters.
events[].body.check_idstringyes(CheckResultBody)
events[].body.regionstringyes(CheckResultBody)
events[].body.node_idstringyes(CheckResultBody)
events[].body.config_versionintegeryes(CheckResultBody)
events[].body.statusstringyes(CheckResultBody) One of up, down, degraded.
events[].body.latency_msintegeryes(CheckResultBody) At least 0.
events[].body.detailobject(CheckResultBody) Map of string to string.
events[].body.errorstring(CheckResultBody) Short reason when not up; omitted when up.
events[].body.signaturestringyes(CheckResultBody)
events[].projectstringyesProject public id.
events[].received_atstring (date-time)yes
next_cursorstring or null
statsobjectyes
stats.rows_scannedinteger
stats.elapsed_msinteger
stats.truncatedbooleanTrue when the plan’s scan limit stopped the query early. The UI says so.

Example

curl -G https://eu.zevsight.com/v1/query/logs \
  -H "Authorization: Bearer <API_KEY>" \
  --data-urlencode "project=all" \
  --data-urlencode "from=2026-11-29T09:00:00Z" \
  --data-urlencode "to=2026-11-29T10:00:00Z" \
  --data-urlencode "q=service:api level:>=error"

Example response (built from the schema; values are illustrative):

{
  "events": [
    {
      "id": "01937a4e-8c2f-7d3a-9b1e-4f6a2c8d0e5b",
      "environment": "production",
      "service": "api",
      "type": "log",
      "ts": "2026-11-29T09:41:07.512Z",
      "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
      "span_id": "00f067aa0ba902b7",
      "severity": "trace",
      "attrs": {
        "key": "attrs.route"
      },
      "resource": {
        "key": "attrs.route"
      },
      "body": {
        "message": "payment provider timeout after 3 retries",
        "fields": {}
      },
      "project": "prj_8KdT3mQ2wXr7nB4cVhY9p",
      "received_at": "2026-11-29T09:41:07.512Z"
    }
  ],
  "next_cursor": null,
  "stats": {
    "rows_scanned": 12,
    "elapsed_ms": 182,
    "truncated": false
  }
}

Lines around an event

GET https://eu.zevsight.com/v1/query/logs/{event_id}/context

The lines around one event (same service, ±30 s by default).

Authentication: Authorization: Bearer <token> with dashboard session, or API key (zsr_…), or legacy agent key (zsa_…).

Parameters

NameInTypeRequiredDescription
event_idpathstring (uuid)yes
projectquerystringyes
beforequeryintegerDefault 50. 0 to 500.
afterqueryintegerDefault 50. 0 to 500.

Responses

StatusDescription
200The event and its neighbours, oldest first.
404No such object, or not visible to this credential (never 403 across tenants).

Response fields (200):

FieldTypeRequiredDescription
anchorobject
anchor.idstring (uuid)yesUUIDv7. Omit to have one generated.
anchor.environmentstringyesDefault production. Pattern ^[a-z0-9][a-z0-9._-]{0,63}$.
anchor.servicestringyesDefault unknown. Pattern ^[a-z0-9][a-z0-9._-]{0,63}$.
anchor.typestringyesOne of log, heartbeat, check_result.
anchor.tsstring (date-time)yes
anchor.trace_idstringPattern ^[0-9a-f]{32}$.
anchor.span_idstringPattern ^[0-9a-f]{16}$.
anchor.severitystringOne of trace, debug, info, warn, error, fatal.
anchor.attrsobjectUp to 128 keys. Map of string to string (values up to 8192 characters).
anchor.resourceobjectUp to 128 keys. Map of string to string (values up to 8192 characters).
anchor.bodyone of LogBody, HeartbeatBody, CheckResultBodyyes
anchor.body.messagestringyes(LogBody) Truncated above 64 KiB.
anchor.body.fieldsobject(LogBody)
anchor.body.monitor_idstringyes(HeartbeatBody)
anchor.body.statusstringyes(HeartbeatBody) One of start, ok, fail.
anchor.body.duration_msinteger(HeartbeatBody) At least 0.
anchor.body.notestring(HeartbeatBody) Up to 8192 characters.
anchor.body.check_idstringyes(CheckResultBody)
anchor.body.regionstringyes(CheckResultBody)
anchor.body.node_idstringyes(CheckResultBody)
anchor.body.config_versionintegeryes(CheckResultBody)
anchor.body.statusstringyes(CheckResultBody) One of up, down, degraded.
anchor.body.latency_msintegeryes(CheckResultBody) At least 0.
anchor.body.detailobject(CheckResultBody) Map of string to string.
anchor.body.errorstring(CheckResultBody) Short reason when not up; omitted when up.
anchor.body.signaturestringyes(CheckResultBody)
anchor.projectstringyesProject public id.
anchor.received_atstring (date-time)yes
eventsarray of EventOut
events[].idstring (uuid)yesUUIDv7. Omit to have one generated.
events[].environmentstringyesDefault production. Pattern ^[a-z0-9][a-z0-9._-]{0,63}$.
events[].servicestringyesDefault unknown. Pattern ^[a-z0-9][a-z0-9._-]{0,63}$.
events[].typestringyesOne of log, heartbeat, check_result.
events[].tsstring (date-time)yes
events[].trace_idstringPattern ^[0-9a-f]{32}$.
events[].span_idstringPattern ^[0-9a-f]{16}$.
events[].severitystringOne of trace, debug, info, warn, error, fatal.
events[].attrsobjectUp to 128 keys. Map of string to string (values up to 8192 characters).
events[].resourceobjectUp to 128 keys. Map of string to string (values up to 8192 characters).
events[].bodyone of LogBody, HeartbeatBody, CheckResultBodyyes
events[].body.messagestringyes(LogBody) Truncated above 64 KiB.
events[].body.fieldsobject(LogBody)
events[].body.monitor_idstringyes(HeartbeatBody)
events[].body.statusstringyes(HeartbeatBody) One of start, ok, fail.
events[].body.duration_msinteger(HeartbeatBody) At least 0.
events[].body.notestring(HeartbeatBody) Up to 8192 characters.
events[].body.check_idstringyes(CheckResultBody)
events[].body.regionstringyes(CheckResultBody)
events[].body.node_idstringyes(CheckResultBody)
events[].body.config_versionintegeryes(CheckResultBody)
events[].body.statusstringyes(CheckResultBody) One of up, down, degraded.
events[].body.latency_msintegeryes(CheckResultBody) At least 0.
events[].body.detailobject(CheckResultBody) Map of string to string.
events[].body.errorstring(CheckResultBody) Short reason when not up; omitted when up.
events[].body.signaturestringyes(CheckResultBody)
events[].projectstringyesProject public id.
events[].received_atstring (date-time)yes

Example

curl -G https://eu.zevsight.com/v1/query/logs/<EVENT_ID>/context \
  -H "Authorization: Bearer <API_KEY>" \
  --data-urlencode "project=all"

Example response (built from the schema; values are illustrative):

{
  "anchor": {
    "id": "01937a4e-8c2f-7d3a-9b1e-4f6a2c8d0e5b",
    "environment": "production",
    "service": "api",
    "type": "log",
    "ts": "2026-11-29T09:41:07.512Z",
    "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
    "span_id": "00f067aa0ba902b7",
    "severity": "trace",
    "attrs": {
      "key": "attrs.route"
    },
    "resource": {
      "key": "attrs.route"
    },
    "body": {
      "message": "payment provider timeout after 3 retries",
      "fields": {}
    },
    "project": "prj_8KdT3mQ2wXr7nB4cVhY9p",
    "received_at": "2026-11-29T09:41:07.512Z"
  },
  "events": [
    {
      "id": "01937a4e-8c2f-7d3a-9b1e-4f6a2c8d0e5b",
      "environment": "production",
      "service": "api",
      "type": "log",
      "ts": "2026-11-29T09:41:07.512Z",
      "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
      "span_id": "00f067aa0ba902b7",
      "severity": "trace",
      "attrs": {
        "key": "attrs.route"
      },
      "resource": {
        "key": "attrs.route"
      },
      "body": {
        "message": "payment provider timeout after 3 retries",
        "fields": {}
      },
      "project": "prj_8KdT3mQ2wXr7nB4cVhY9p",
      "received_at": "2026-11-29T09:41:07.512Z"
    }
  ]
}

Histogram

GET https://eu.zevsight.com/v1/query/histogram

Event counts over time, by level, for the explorer’s volume chart.

Buckets are dense from the bucket containing from to the one containing to, aligned to the epoch. The bucket size is the smallest of 1s, 5s, 15s, 30s, 1m, 5m, 15m, 30m, 1h, 3h, 6h, 12h, 1d (then whole days) that fits the range in at most buckets buckets. Level keys are trace, debug, info, warn, error, fatal and none (heartbeats and check results carry no level); zero counts are left out.

Authentication: Authorization: Bearer <token> with dashboard session, or API key (zsr_…), or legacy agent key (zsa_…).

Parameters

NameInTypeRequiredDescription
projectquerystringyesProject public ids, comma-separated, or all: every project the caller may read in this region.
fromquerystring (date-time)yes
toquerystring (date-time)Defaults to now.
qquerystringSame grammar as /v1/query/logs. Up to 2000 characters.
envquerystringEnvironments to include, comma-separated (the same as env: terms joined by OR).
bucketsqueryintegerDefault 60. 1 to 200.

Responses

StatusDescription
200The histogram.
400The request, or every event in it, is invalid.
401Missing, unknown, expired or wrong-kind credential.
404No such object, or not visible to this credential (never 403 across tenants).
503The queue is unavailable or full. Nothing was stored; retry. Headers: Retry-After.

Response fields (200):

FieldTypeRequiredDescription
bucket_secondsintegeryes
bucketsarray of objectyes
buckets[].tstring (date-time)yes
buckets[].countsobjectyesCounts by level key (trace…fatal, none). Zero counts omitted. Map of string to integer.
totalintegeryes
truncatedbooleanyes
statsobject
stats.rows_scannedinteger
stats.elapsed_msinteger

Example

curl -G https://eu.zevsight.com/v1/query/histogram \
  -H "Authorization: Bearer <API_KEY>" \
  --data-urlencode "project=all" \
  --data-urlencode "from=2026-11-29T09:00:00Z" \
  --data-urlencode "to=2026-11-29T10:00:00Z" \
  --data-urlencode "q=service:api level:>=error"

Example response (built from the schema; values are illustrative):

{
  "bucket_seconds": 12,
  "buckets": [
    {
      "t": "2026-11-29T09:41:07.512Z",
      "counts": {
        "error": null
      }
    }
  ],
  "total": 12,
  "truncated": false,
  "stats": {
    "rows_scanned": 12,
    "elapsed_ms": 182
  }
}

Facets

GET https://eu.zevsight.com/v1/query/facets

Value counts per field, and the most common attribute keys.

Field counts are exact over the matching rows (within the plan’s scan limit). Attribute and resource keys are counted over the newest 100,000 matching rows: only the newest slice of the range that holds them is read (found from per-minute counts), and that read is capped at 2,000,000 rows. sampled is true when there were more matching rows, or the cap was reached.

Authentication: Authorization: Bearer <token> with dashboard session, or API key (zsr_…), or legacy agent key (zsa_…).

Parameters

NameInTypeRequiredDescription
projectquerystringyesProject public ids, comma-separated, or all: every project the caller may read in this region.
fromquerystring (date-time)yes
toquerystring (date-time)Defaults to now.
qquerystringSame grammar as /v1/query/logs. Up to 2000 characters.
envquerystringEnvironments to include, comma-separated (the same as env: terms joined by OR).
fieldsquerystringComma-separated subset of project, environment, service, severity, type. Default all five.
keysqueryintegerHow many attribute/resource keys to return; 0 skips them. Default 10. 0 to 100.
valuesqueryintegerValues per field. Default 10. 1 to 100.

Responses

StatusDescription
200The facets.
400The request, or every event in it, is invalid.
401Missing, unknown, expired or wrong-kind credential.
404No such object, or not visible to this credential (never 403 across tenants).
503The queue is unavailable or full. Nothing was stored; retry. Headers: Retry-After.

Response fields (200):

FieldTypeRequiredDescription
fieldsobjectyesMap of string to array of FacetValue.
keysarray of objectyes
keys[].keystring
keys[].countinteger
totalintegeryes
sampledbooleanyes
truncatedbooleanyes
statsobject
stats.rows_scannedinteger
stats.elapsed_msinteger

Example

curl -G https://eu.zevsight.com/v1/query/facets \
  -H "Authorization: Bearer <API_KEY>" \
  --data-urlencode "project=all" \
  --data-urlencode "from=2026-11-29T09:00:00Z" \
  --data-urlencode "to=2026-11-29T10:00:00Z" \
  --data-urlencode "q=service:api level:>=error"

Example response (built from the schema; values are illustrative):

{
  "fields": {
    "service": "api"
  },
  "keys": [
    {
      "key": "attrs.route",
      "count": 12
    }
  ],
  "total": 12,
  "sampled": false,
  "truncated": false,
  "stats": {
    "rows_scanned": 12,
    "elapsed_ms": 182
  }
}

Facet values

GET https://eu.zevsight.com/v1/query/facets/values

Top values of one field or attribute, optionally by prefix (autocomplete, “show more”).

Authentication: Authorization: Bearer <token> with dashboard session, or API key (zsr_…), or legacy agent key (zsa_…).

Parameters

NameInTypeRequiredDescription
projectquerystringyesProject public ids, comma-separated, or all: every project the caller may read in this region.
fromquerystring (date-time)yes
toquerystring (date-time)Defaults to now.
qquerystringSame grammar as /v1/query/logs. Up to 2000 characters.
envquerystringEnvironments to include, comma-separated (the same as env: terms joined by OR).
keyquerystringyesproject, environment, service, severity, type, attrs.<name> or resource.<name>.
prefixquerystringUp to 256 characters.
limitqueryintegerDefault 20. 1 to 200.

Responses

StatusDescription
200The values.
400The request, or every event in it, is invalid.
401Missing, unknown, expired or wrong-kind credential.
404No such object, or not visible to this credential (never 403 across tenants).
503The queue is unavailable or full. Nothing was stored; retry. Headers: Retry-After.

Response fields (200):

FieldTypeRequiredDescription
keystringyes
valuesarray of FacetValueyes
values[].valuestringyesFor project, the public id; for severity, a level key.
values[].countintegeryes
truncatedbooleanyes
sampledbooleanFor attrs.<name> and resource.<name>: values were counted over the newest 500,000 matching lines (capped at 10,000,000 rows read), not the whole range. Fields (project, environment, …) are exact and never sampled.
statsobject
stats.rows_scannedinteger
stats.elapsed_msinteger

Example

curl -G https://eu.zevsight.com/v1/query/facets/values \
  -H "Authorization: Bearer <API_KEY>" \
  --data-urlencode "project=all" \
  --data-urlencode "from=2026-11-29T09:00:00Z" \
  --data-urlencode "to=2026-11-29T10:00:00Z" \
  --data-urlencode "q=service:api level:>=error" \
  --data-urlencode "key=attrs.route"

Example response (built from the schema; values are illustrative):

{
  "key": "attrs.route",
  "values": [
    {
      "value": "api",
      "count": 12
    }
  ],
  "truncated": false,
  "sampled": false,
  "stats": {
    "rows_scanned": 12,
    "elapsed_ms": 182
  }
}

Patterns

GET https://eu.zevsight.com/v1/query/patterns

Log lines grouped by message template.

Templates replace the parts of a message that vary with placeholders: <uuid>, <time>, <email>, <ip>, <str> (quoted), <n> (numbers, with an optional short unit such as ms or %) and <hex> (hex runs of 8 or more). Only log events with a message are grouped, over the newest 200,000 matching lines: only the newest slice of the range that holds them is read (found from per-minute counts), capped at 4,000,000 rows read. sampled when there were more lines, or the cap was reached.

Authentication: Authorization: Bearer <token> with dashboard session, or API key (zsr_…), or legacy agent key (zsa_…).

Parameters

NameInTypeRequiredDescription
projectquerystringyesProject public ids, comma-separated, or all: every project the caller may read in this region.
fromquerystring (date-time)yes
toquerystring (date-time)Defaults to now.
qquerystringSame grammar as /v1/query/logs. Up to 2000 characters.
envquerystringEnvironments to include, comma-separated (the same as env: terms joined by OR).
limitqueryintegerDefault 50. 1 to 500.

Responses

StatusDescription
200The patterns, most frequent first.
400The request, or every event in it, is invalid.
401Missing, unknown, expired or wrong-kind credential.
404No such object, or not visible to this credential (never 403 across tenants).
503The queue is unavailable or full. Nothing was stored; retry. Headers: Retry-After.

Response fields (200):

FieldTypeRequiredDescription
patternsarray of objectyes
patterns[].patternstringyes
patterns[].countintegeryes
patterns[].levelsobjectyesMap of string to integer.
patterns[].first_seenstring (date-time)yes
patterns[].last_seenstring (date-time)yes
patterns[].sample_idstring (uuid)yes
patterns[].samplestringyesThe newest line with this pattern.
totalintegeryesMatching log lines in the range (lines with an empty message included, though they are not grouped).
sampledbooleanyes
truncatedbooleanyes
statsobject
stats.rows_scannedinteger
stats.elapsed_msinteger

Example

curl -G https://eu.zevsight.com/v1/query/patterns \
  -H "Authorization: Bearer <API_KEY>" \
  --data-urlencode "project=all" \
  --data-urlencode "from=2026-11-29T09:00:00Z" \
  --data-urlencode "to=2026-11-29T10:00:00Z" \
  --data-urlencode "q=service:api level:>=error"

Example response (built from the schema; values are illustrative):

{
  "patterns": [
    {
      "pattern": "payment provider timeout after <n> retries",
      "count": 12,
      "levels": {
        "error": null
      },
      "first_seen": "2026-11-29T09:41:07.512Z",
      "last_seen": "2026-11-29T09:41:07.512Z",
      "sample_id": "01937a4e-8c2f-7d3a-9b1e-4f6a2c8d0e5b",
      "sample": "payment provider timeout after 3 retries"
    }
  ],
  "total": 12,
  "sampled": false,
  "truncated": false,
  "stats": {
    "rows_scanned": 12,
    "elapsed_ms": 182
  }
}

Built 29 November 2026 · View as Markdown