# rest api

hydrant's REST API is split into public endpoints (safe to expose) and management endpoints (keep private). see [getting started](https://hydrant.klbr.net/getting-started/index.md#reverse-proxying) for guidance on what to expose.

## public

- `GET /stream`: [stream API](https://hydrant.klbr.net/api/stream/index.md), subscribe to the ordered websocket event stream.
- `GET /stream/head`: [stream API](https://hydrant.klbr.net/api/stream/index.md#get-streamhead), get the newest durable event ID to detect when a replay has caught up.
- `GET /subscribe`: [jetstream API](https://hydrant.klbr.net/api/jetstream/index.md), subscribe to a filtered, jetstream-compatible websocket event stream.
- `GET /stats`: get stats about the database (counts of repos, records, events; sizes of keyspaces on disk).
- `GET /health` / `GET /_health` / `GET /version` / `GET /_version`: health check; returns the running version as JSON (`{"name","version","mode"}`).

## management

only served on `unix:` binds unless `HYDRANT_API_TCP_MANAGEMENT=true`, see [getting started](https://hydrant.klbr.net/getting-started/index.md#reverse-proxying).


- [filter](https://hydrant.klbr.net/api/filter/index.md): NSID filter configuration
- [ingestion](https://hydrant.klbr.net/api/ingestion/index.md): enable/disable crawler, firehose, backfill at runtime
- [crawler](https://hydrant.klbr.net/api/crawler/index.md): crawler source management
- [firehose](https://hydrant.klbr.net/api/firehose/index.md): firehose source management
- [pds](https://hydrant.klbr.net/api/pds/index.md): bans and rate-limit tier assignments
- [repos](https://hydrant.klbr.net/api/repos/index.md): explicit repository tracking, resyncing, untracking
- [database](https://hydrant.klbr.net/api/database/index.md): compression training, compaction
