---
title: API overview
description: "ZevSight's HTTP API: hosts, authentication, error format, rate limits, pagination and idempotency, with links to the generated reference."
url: https://docs.zevsight.com/api
---

# API overview

> ZevSight's HTTP API: hosts, authentication, error format, rate limits, pagination and idempotency, with links to the generated reference.

The ZevSight API sends data in and reads it back: ingest, heartbeat pings, search, live tail, uptime check data, alert actions and notes. Projects, services, checks, rules and keys are configured in the dashboard.

The machine-readable description is [`/openapi.yaml`](/openapi.yaml) (OpenAPI 3.1). It is copied from the engine on every docs build, and the reference pages below are generated from it.

## Hosts

| Host | Serves | Credential |
|---|---|---|
| `https://ingest.zevsight.com` | [Ingest](/api/reference/ingest), [heartbeat pings](/api/reference/heartbeats) | Ingest token; the ping URL itself |
| `https://eu.zevsight.com` | [Query](/api/reference/query), [live tail](/api/reference/live-tail) (`wss://`), [uptime checks](/api/reference/uptime-checks), [alerts](/api/reference/alerts) | API key |
| `https://api.zevsight.com` | [Notes](/api/notes) on incidents and alerts | API key with `respond` |

These are the EU data region's hosts, the only region today. Using a credential on another region's host returns `421 WRONG_REGION` with the right host in `endpoint`.

## Authentication

```http
Authorization: Bearer <KEY>
```

| Credential | Prefix | Accepted by |
|---|---|---|
| Ingest token | `zsi_` | Ingest endpoints only |
| API key, `read` | `zsr_` | Query, live tail, uptime checks, listing alerts |
| API key, `respond` | `zsr_` | All of the above, plus alert actions and notes |
| Legacy agent key | `zsa_` | Like an API key; new keys are `zsr_` |

Live tail takes the key in its first WebSocket frame instead of a header. Heartbeat pings need no header. See [API keys and ingest tokens](/workspace/api-keys).

## Conventions

- JSON bodies, UTF-8. Times are RFC 3339 in UTC.
- Public ids on the wire: `prj_…` (project), `chk_…` (check), `inc_…` (incident), `hb_…` (heartbeat). Event and alert ids are UUIDs (UUIDv7).
- Many query endpoints take `project` as a comma-separated list of project ids, or `all` for every project the key can read.
- `from` and `to` are RFC 3339. `to` defaults to now.

## Errors

Errors have one shape:

```json
{
  "code": "INVALID_REQUEST",
  "message": "A sentence saying what is wrong.",
  "field": "q"
}
```

`code` is stable; `message` is a sentence for people and may change. `reference` appears on `INTERNAL_ERROR` (quote it to support), and `endpoint` on `WRONG_REGION`.

| Code | Status | Meaning |
|---|---|---|
| `INVALID_REQUEST` | 400 | The request is invalid. `field` names the problem when there is one. |
| `UNAUTHENTICATED` | 401 | Missing, unknown, expired or wrong kind of credential |
| `FORBIDDEN` | 403 | Valid credential, but not allowed (a `read` key on an action, a viewer) |
| `NOT_FOUND` | 404 | No such object, or not visible to this credential. Never `403` across workspaces. |
| `CONFLICT` | 409 | For example, the alert is already resolved |
| `WRONG_REGION` | 421 | Use the host in `endpoint` |
| `PAYLOAD_TOO_LARGE` | 413 | Over 5 MiB decompressed or 5,000 events |
| `RATE_LIMITED` | 429 | Too many requests. Wait `Retry-After` seconds. |
| `QUOTA_EXCEEDED` | 429 | Monthly ingest quota reached. `Retry-After` points at the next month. |
| `UNAVAILABLE` | 503 | Nothing was done. Retry after `Retry-After`. |
| `INTERNAL_ERROR` | 500 | Our fault. Retry, and quote `reference` if it persists. |

Creating something past a plan limit in the dashboard reports `PLAN_LIMIT`.

## Rate limits

| What | Limit | Response |
|---|---|---|
| Ingest | Events per second per workspace, set by the plan; monthly quota | `429 RATE_LIMITED` or `QUOTA_EXCEEDED` with `Retry-After` |
| Heartbeat pings | 2 per second per monitor, bursts of 10 | `429 RATE_LIMITED` |
| Queries | 8 running at once per credential | `429` |
| Rows scanned per query | Set by the plan | `200` with `stats.truncated: true` |
| Live tail | 50 open per workspace | Close code `4429` |
| Notes | 30 per minute per key | `429` with `Retry-After` |

Always honour `Retry-After`.

## Pagination

- **Log search** returns newest first. Pass `next_cursor` from one response as `cursor` in the next. It is opaque and `null` on the last page. `limit` is 1 to 1,000 (default 200).
- **Check results** return newest first. Pass `next_before` as `before`.
- Facets, values and patterns return the top entries; raise `limit`, `values` or `keys` for more.

## Idempotency

Ingest accepts an `Idempotency-Key` header (up to 128 characters, remembered for 2 hours), and deduplicates by event `id`. Acknowledging an alert twice is harmless.

> **Note**
>
> Responses from aggregate endpoints include `sampled` or `truncated` flags. Pass them on to your users or agent so nobody mistakes a partial count for the whole picture.

## Reference

- [Ingest](/api/reference/ingest)
- [Heartbeat pings](/api/reference/heartbeats)
- [Query](/api/reference/query)
- [Live tail](/api/reference/live-tail)
- [Uptime checks](/api/reference/uptime-checks)
- [Alerts](/api/reference/alerts)
- [Notes](/api/notes)
