---
title: Ingest API reference
description: Reference for POST /v1/ingest/events and the OTLP/HTTP logs endpoint, generated from the ZevSight OpenAPI file.
url: https://docs.zevsight.com/api/reference/ingest
---

# Ingest API reference

> Reference for POST /v1/ingest/events and the OTLP/HTTP logs endpoint, generated from the ZevSight OpenAPI file.

Send events, natively or over OTLP/HTTP, with an ingest key.

Send events with an ingest token (`zsi_…`). Guides: [HTTP ingest API](/send/http-api), [OpenTelemetry](/send/opentelemetry), [Limits and batching](/send/limits).

Base URL: `https://ingest.zevsight.com`. Machine-readable: [/openapi.yaml](/openapi.yaml).

## Send events

`POST https://ingest.zevsight.com/v1/ingest/events`

Send a batch of events in ZevSight's native format.

**Authentication:** `Authorization: Bearer <token>` with Ingest token (`zsi_…`).

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `Idempotency-Key` | header | string |  | Up to 128 characters. A retry with the same key within 2 hours is accepted again without storing anything twice. Up to 128 characters. |
| `Content-Encoding` | header | string |  | One of `gzip`, `zstd`, `identity`. |

### Request body

Content type: `application/json` or `application/x-ndjson`.

| Field | Type | Required | Description |
|---|---|---|---|
| `events` | array of EventIn | yes | 1 to 5000 items. |
| `events[].id` | string (uuid) |  | UUIDv7. Omit to have one generated. |
| `events[].environment` | string |  | Default `production`. Pattern `^[a-z0-9][a-z0-9._-]{0,63}$`. |
| `events[].service` | string |  | Default `unknown`. Pattern `^[a-z0-9][a-z0-9._-]{0,63}$`. |
| `events[].type` | string | yes | One of `log`, `heartbeat`, `check_result`. |
| `events[].ts` | string (date-time) |  |  |
| `events[].trace_id` | string |  | Pattern `^[0-9a-f]{32}$`. |
| `events[].span_id` | string |  | Pattern `^[0-9a-f]{16}$`. |
| `events[].severity` | string |  | A level name (any common logger spelling) or omitted. |
| `events[].attrs` | object |  | Up to 128 keys. Map of string to string (values up to 8192 characters). |
| `events[].resource` | object |  | Up to 128 keys. Map of string to string (values up to 8192 characters). |
| `events[].body` | one of LogBody, HeartbeatBody, CheckResultBody | yes |  |
| `events[].body.message` | string | yes | (LogBody) Truncated above 64 KiB. |
| `events[].body.fields` | object |  | (LogBody) |
| `events[].body.monitor_id` | string | yes | (HeartbeatBody) |
| `events[].body.status` | string | yes | (HeartbeatBody) One of `start`, `ok`, `fail`. |
| `events[].body.duration_ms` | integer |  | (HeartbeatBody) At least 0. |
| `events[].body.note` | string |  | (HeartbeatBody) Up to 8192 characters. |
| `events[].body.check_id` | string | yes | (CheckResultBody) |
| `events[].body.region` | string | yes | (CheckResultBody) |
| `events[].body.node_id` | string | yes | (CheckResultBody) |
| `events[].body.config_version` | integer | yes | (CheckResultBody) |
| `events[].body.status` | string | yes | (CheckResultBody) One of `up`, `down`, `degraded`. |
| `events[].body.latency_ms` | integer | yes | (CheckResultBody) At least 0. |
| `events[].body.detail` | object |  | (CheckResultBody) Map of string to string. |
| `events[].body.error` | string |  | (CheckResultBody) Short reason when not up; omitted when up. |
| `events[].body.signature` | string | yes | (CheckResultBody) |

`application/x-ndjson`: One EventIn per line. Same limits.

### Responses

| Status | Description |
|---|---|
| `202` | Durably queued. Searchable within seconds; visible in live tail sooner. |
| `400` | The request, or every event in it, is invalid. |
| `401` | Missing, unknown, expired or wrong-kind credential. |
| `413` | Over 5 MiB decompressed or 5,000 events. |
| `421` | The credential belongs to another data region. Nothing was stored or forwarded; `endpoint` names the right host. |
| `429` | Burst limit (`RATE_LIMITED`) or monthly quota (`QUOTA_EXCEEDED`). Headers: `Retry-After`. |
| `503` | The queue is unavailable or full. Nothing was stored; retry. Headers: `Retry-After`. |

Response fields (`202`):

| Field | Type | Required | Description |
|---|---|---|---|
| `accepted` | integer | yes |  |
| `rejected` | array of object |  | Events refused individually (the rest were accepted). |
| `rejected[].index` | integer |  |  |
| `rejected[].field` | string |  |  |
| `rejected[].message` | string |  |  |
| `quota` | object |  | Present when the project is at 80% of its monthly ingest or above. |
| `quota.used_ratio` | number |  |  |
| `quota.state` | string |  | One of `warning`, `over`, `warn_and_above_only`. |

### Example

```bash
curl -X POST https://ingest.zevsight.com/v1/ingest/events \
  -H "Authorization: Bearer <INGEST_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"events":[{"service":"api","environment":"production","type":"log","severity":"error","attrs":{"route":"/v1/pay","user.id":"42"},"body":{"message":"payment provider timeout after 3 retries","fields":{"provider":"card","attempt":3}}}]}'
```

Example response:

```json
{
  "accepted": 1,
  "rejected": []
}
```

## Send OTLP logs

`POST https://ingest.zevsight.com/v1/ingest/otlp/logs`

OTLP/HTTP log export.

Standard OTLP/HTTP `ExportLogsServiceRequest`, protobuf or JSON. Point
any OpenTelemetry SDK or collector here with the ingest key in the
`Authorization` header. Resource attribute `service.name` becomes
`service`; `deployment.environment.name` (or the older
`deployment.environment`) becomes `environment`; other resource
attributes go to `resource`; record attributes to `attrs`.
Responses follow the OTLP/HTTP spec, including `partial_success`.

**Authentication:** `Authorization: Bearer <token>` with Ingest token (`zsi_…`).

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `Idempotency-Key` | header | string |  | Up to 128 characters. A retry with the same key within 2 hours is accepted again without storing anything twice. Up to 128 characters. |

### Request body

Content type: `application/x-protobuf` or `application/json`.

### Responses

| Status | Description |
|---|---|
| `200` | Accepted (OTLP success, possibly with partial_success). |
| `400` | The request, or every event in it, is invalid. |
| `401` | Missing, unknown, expired or wrong-kind credential. |
| `413` | Over 5 MiB decompressed or 5,000 events. |
| `421` | The credential belongs to another data region. Nothing was stored or forwarded; `endpoint` names the right host. |
| `429` | Burst limit (`RATE_LIMITED`) or monthly quota (`QUOTA_EXCEEDED`). Headers: `Retry-After`. |
| `503` | The queue is unavailable or full. Nothing was stored; retry. Headers: `Retry-After`. |

### Example

```bash
curl -X POST https://ingest.zevsight.com/v1/ingest/otlp/logs \
  -H "Authorization: Bearer <INGEST_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"resourceLogs":[{"resource":{"attributes":[
        {"key":"service.name","value":{"stringValue":"api"}},
        {"key":"deployment.environment.name","value":{"stringValue":"production"}}]},
      "scopeLogs":[{"logRecords":[{"severityText":"ERROR",
        "body":{"stringValue":"payment provider timeout"},
        "attributes":[{"key":"route","value":{"stringValue":"/v1/pay"}}]}]}]}]}'
```
