> ## Documentation Index
> Fetch the complete documentation index at: https://sariva.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API

> The Sariva platform's REST API — the spine that Slack, the CLI, and integrations all run on.

Every interface — Slack, the `sariva` CLI, application registration — runs on one REST API. You can call it directly to build your own integrations.

## Base URL & auth

* **Base URL** — your platform URL. On EKS, in-cluster that's typically `http://sariva-platform.<namespace>.svc:8000`, or whatever route your operator exposes. On the [VM path](https://sariva.mintlify.site/deploy/vm-docker-cc.md) it is `http://localhost:8000` on the host, or the public HTTPS name you put in front of it. All routes are under `/api/v1`.
* **Auth** — a Sariva platform API key as a **bearer token**:

  ```
  Authorization: Bearer sariva_<your-key>
  ```

  Mint one as described in [Mint your admin bearer](https://sariva.mintlify.site/install-setup/mint-bearer.md). (Slack-driven flows don't need this — Slack identity is resolved separately.)

## The authoritative contract: OpenAPI

The always-current, machine-readable contract is the OpenAPI schema:

```bash theme={null}
curl https://<platform-url>/api/v1/openapi.json
```

> [!WARNING]
>
> Note the **`/api/v1`** prefix — `/openapi.json` at the root returns `404`. Point Swagger UI, Postman, or an OpenAPI client generator at `/api/v1/openapi.json`.

The endpoints below are the most common ones; the OpenAPI schema is the full surface.

## Health

```bash theme={null}
curl https://<platform-url>/api/v1/health
```

`llm.state` is the AI backend as the last model call found it: `ok`, `billing` (out of credits), `auth` (key or credentials rejected), `rate_limited`, `unreachable`, or `unknown` (no call yet since start). Any state but `ok` and `unknown` sets `llm_reachable: false` and `status: "degraded"` — still HTTP `200`, so the install stays in service and can say so. While the model is down the chat reads no message: every reply says it cannot read messages right now, that nothing was done and that anything waiting is still waiting. A `billing` or `auth` failure posts one alert to the alerts channel (and one low-severity page) when it starts and one when it clears.

## Applications

The developer self-service surface (see [Register an application](https://sariva.mintlify.site/app-teams/register.md) for the full field reference):

| Method & path | Purpose |
| - | - |
| `POST /api/v1/apps/register` | Register an app; returns the record + a generated client config |
| `GET /api/v1/apps/` | List your team's apps |
| `GET /api/v1/apps/{alias}` | App detail + current health summary |
| `PUT /api/v1/apps/{alias}` | Update alert preferences |
| `DELETE /api/v1/apps/{alias}` | De-register |
| `GET /api/v1/apps/{alias}/config` | Re-download the client config |
| `GET /api/v1/apps/{alias}/health` | Pod status (Kubernetes only) + the last alert + per-type `alert_lifecycle` (active / clear); a producer's verdict from its pod and topics. Never reads the app's logs (`"logs": "not_read"`) |

```bash theme={null}
curl https://<platform-url>/api/v1/apps/payments-consumer/health \
  -H "Authorization: Bearer sariva_<your-key>"
```

## Cluster operations

Registering clusters, attaching credentials, and verifying ACLs are REST operations too — but most operators drive them through the `sariva` CLI, which is itself a REST client (`--api-url` + `--api-key`). See [Connecting Kafka clusters](https://sariva.mintlify.site/connecting-clusters/overview.md). The exact routes are in the OpenAPI schema.

## Built for AI agents

Every endpoint carries machine-readable **intent + safety metadata** (surfaced in the OpenAPI `description`), so an AI agent can tell a read from an irreversible write before calling. The same metadata powers the [MCP server](https://sariva.mintlify.site/api-mcp/mcp.md), which is the recommended way for external AI agents to call the Sariva platform.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.