# REST API

> Every Livops API endpoint — a list generated automatically from the routes in the backend code.

Source: https://livops.dev/en/docs/api

Everything the cabinet does goes through this API. The list below is generated automatically from the backend routes (`scripts/docs-api.mjs`), so it always matches the code.

## Basics

- **Base URL:** `https://livops.uz/api`
- **Authentication:** `Authorization: Bearer lvp_...` — an [API token](https://livops.dev/en/docs/api-tokens).
- **Format:** requests and responses are JSON (`Content-Type: application/json`).
- **Team:** a token is bound to one team, so the `X-Team` header is not needed.
- `{id}` in a path is a service identifier (called "project" in the code); `{stack}` is a project.

```bash
curl https://livops.uz/api/projects \
  -H 'Authorization: Bearer lvp_xxx'
```

## Labels

- **API token** — can be called with a token.
- **Browser session only** — cabinet only: a token gets `403`. This covers account security, tokens, team and billing, any deletion, and more — [see the list](https://livops.dev/en/docs/api-tokens#what-a-token-cant-do).
- **No token** — the token in the URL is the key itself (for example, a [deploy hook](https://livops.dev/en/docs/deploy-hooks)).

Roles are checked too: people with the `viewer` or `billing` role can't change anything — [Team and roles](https://livops.dev/en/docs/teams).

## Response codes

| Code | Meaning |
| --- | --- |
| `200`, `201` | Success |
| `400` | Bad request (a field is missing or invalid) |
| `401` | Token missing or revoked |
| `403` | This action is closed to your token or role |
| `404` | Not found — or belongs to another team |
| `429` | Too many requests, try again later |

241 endpoints

## /account

- `DELETE /account` — Browser session only
- `GET /account` — Browser session only
- `PATCH /account` — Browser session only
- `GET /account/ai-apps` — Browser session only
- `DELETE /account/ai-apps/{id}` — Browser session only
- `GET /account/apps` — Browser session only
- `POST /account/apps` — Browser session only
- `DELETE /account/apps/{id}` — Browser session only
- `PUT /account/apps/{id}` — Browser session only
- `PUT /account/password` — Browser session only
- `DELETE /account/sessions` — Browser session only
- `GET /account/sessions` — Browser session only
- `DELETE /account/sessions/{id}` — Browser session only
- `GET /account/ssh-keys` — Browser session only
- `POST /account/ssh-keys` — Browser session only
- `DELETE /account/ssh-keys/{id}` — Browser session only
- `GET /account/tokens` — Browser session only
- `POST /account/tokens` — Browser session only
- `DELETE /account/tokens/{id}` — Browser session only

## /assist

- `GET /assist` — With an API token
- `PUT /assist/auto` — Browser session only
- `POST /assist/chat` — Browser session only
- `PUT /assist/enabled` — Browser session only

## /auth

- `POST /auth/address/confirm` — Browser session only
- `POST /auth/address/resend` — Browser session only
- `GET /auth/me` — With an API token
- `GET /auth/second-factor` — Browser session only
- `POST /auth/second-factor` — Browser session only
- `POST /auth/second-factor/disable` — Browser session only
- `POST /auth/second-factor/enable` — Browser session only
- `POST /auth/second-factor/recovery-codes` — Browser session only
- `POST /auth/second-factor/setup` — Browser session only
- `GET /auth/security-events` — Browser session only

## /badge

- `GET /badge/{file}` — No token

## /billing

- `GET /billing` — With an API token
- `DELETE /billing/card` — Browser session only
- `GET /billing/card` — With an API token
- `POST /billing/card` — Browser session only
- `POST /billing/card/pause` — Browser session only
- `POST /billing/card/resume` — Browser session only
- `POST /billing/card/verify` — Browser session only
- `GET /billing/history` — With an API token
- `GET /billing/ledger` — With an API token
- `GET /billing/months` — With an API token
- `POST /billing/pay` — Browser session only
- `POST /billing/payments/{id}/abandon` — Browser session only
- `GET /billing/payments/{id}/receipt` — With an API token
- `GET /billing/plan` — With an API token
- `PUT /billing/plan` — Browser session only
- `POST /billing/promo` — Browser session only
- `POST /billing/topup` — Browser session only

## /bots

- `POST /bots/check` — Browser session only

## /cases

- `GET /cases` — With an API token
- `POST /cases` — Browser session only
- `GET /cases/{id}` — With an API token
- `GET /cases/{id}/files` — With an API token
- `POST /cases/{id}/files` — Browser session only
- `GET /cases/{id}/files/{fileId}` — With an API token
- `POST /cases/{id}/messages` — Browser session only
- `POST /cases/{id}/resolve` — Browser session only

## /databases

- `POST /databases` — Browser session only

## /deploys

- `GET /deploys` — With an API token
- `GET /deploys/{id}` — With an API token
- `POST /deploys/{id}/cancel` — With an API token
- `POST /deploys/{id}/explain` — With an API token

## /domains

- `DELETE /domains/{domainId}` — Browser session only
- `POST /domains/{domainId}/check` — Browser session only
- `PUT /domains/{domainId}/redirect` — Browser session only

## /handovers

- `GET /handovers` — With an API token
- `POST /handovers/{id}/accept` — Browser session only
- `POST /handovers/{id}/decline` — Browser session only

## /hooks

- `POST /hooks/deploy/{token}` — No token

## /mcp

- `POST /mcp` — With an API token
- `POST /mcp/oauth/decide` — Browser session only
- `GET /mcp/oauth/request` — Browser session only

## /notifications

- `GET /notifications` — With an API token
- `POST /notifications/{id}/read` — Browser session only
- `POST /notifications/events/read` — Browser session only
- `POST /notifications/read` — Browser session only
- `DELETE /notifications/telegram` — Browser session only
- `GET /notifications/telegram` — With an API token

## /presets

- `GET /presets` — With an API token

## /projects

- `GET /projects` — With an API token
- `POST /projects` — With an API token
- `DELETE /projects/{id}` — Browser session only
- `GET /projects/{id}` — With an API token
- `PUT /projects/{id}` — With an API token
- `PUT /projects/{id}/address` — With an API token
- `GET /projects/{id}/analytics` — With an API token
- `PUT /projects/{id}/analytics` — With an API token
- `GET /projects/{id}/analytics/breakdown` — With an API token
- `GET /projects/{id}/analytics/online` — With an API token
- `POST /projects/{id}/bot-mode` — With an API token
- `POST /projects/{id}/commands` — With an API token
- `POST /projects/{id}/cron/run` — With an API token
- `GET /projects/{id}/cron/runs` — With an API token
- `GET /projects/{id}/databases` — With an API token
- `POST /projects/{id}/databases` — With an API token
- `DELETE /projects/{id}/databases/{db}` — Browser session only
- `GET /projects/{id}/databases/{db}/backups` — Browser session only
- `GET /projects/{id}/databases/{db}/backups/{snap}/download` — Browser session only
- `POST /projects/{id}/databases/{db}/backups/{snap}/restore` — Browser session only
- `GET /projects/{id}/databases/{db}/connection` — Browser session only
- `GET /projects/{id}/databases/{db}/extensions` — With an API token
- `PUT /projects/{id}/databases/{db}/extensions/{name}` — With an API token
- `GET /projects/{id}/databases/{db}/logs/stream` — With an API token
- `GET /projects/{id}/databases/{db}/metrics` — With an API token
- `POST /projects/{id}/databases/{db}/query` — With an API token
- `GET /projects/{id}/databases/{db}/readonly` — With an API token
- `POST /projects/{id}/databases/{db}/readonly` — With an API token
- `GET /projects/{id}/databases/{db}/tables` — With an API token
- `GET /projects/{id}/databases/{db}/tables/{schema}/{table}` — With an API token
- `PUT /projects/{id}/databases/{db}/tier` — With an API token
- `GET /projects/{id}/databases/{db}/usage` — With an API token
- `GET /projects/{id}/databases/{db}/users` — With an API token
- `DELETE /projects/{id}/deploy-hook` — Browser session only
- `GET /projects/{id}/deploy-hook` — Browser session only
- `POST /projects/{id}/deploy-hook` — Browser session only
- `GET /projects/{id}/deploys` — With an API token
- `POST /projects/{id}/deploys` — With an API token
- `POST /projects/{id}/deploys/{deployId}/rollback` — With an API token
- `GET /projects/{id}/domains` — With an API token
- `POST /projects/{id}/domains` — With an API token
- `GET /projects/{id}/env` — With an API token
- `PATCH /projects/{id}/env` — With an API token
- `PUT /projects/{id}/env` — With an API token
- `GET /projects/{id}/form-submissions` — With an API token
- `GET /projects/{id}/form-submissions.csv` — With an API token
- `DELETE /projects/{id}/form-submissions/{sub}` — Browser session only
- `PATCH /projects/{id}/form-submissions/{sub}` — With an API token
- `GET /projects/{id}/forms` — With an API token
- `POST /projects/{id}/gitlab-hook` — With an API token
- `DELETE /projects/{id}/handover` — Browser session only
- `GET /projects/{id}/handover` — Browser session only
- `POST /projects/{id}/handover` — Browser session only
- `GET /projects/{id}/images` — With an API token
- `PUT /projects/{id}/images` — With an API token
- `DELETE /projects/{id}/log-drain` — Browser session only
- `GET /projects/{id}/log-drain` — Browser session only
- `PUT /projects/{id}/log-drain` — Browser session only
- `GET /projects/{id}/logs/stream` — With an API token
- `GET /projects/{id}/members` — With an API token
- `POST /projects/{id}/members` — Browser session only
- `DELETE /projects/{id}/members/{memberId}` — Browser session only
- `GET /projects/{id}/metrics` — With an API token
- `POST /projects/{id}/output` — With an API token
- `POST /projects/{id}/promote` — With an API token
- `GET /projects/{id}/protection` — With an API token
- `PUT /projects/{id}/protection` — With an API token
- `POST /projects/{id}/push-secret` — With an API token
- `POST /projects/{id}/root` — With an API token
- `GET /projects/{id}/routes` — With an API token
- `PUT /projects/{id}/routes` — With an API token
- `GET /projects/{id}/runtime` — With an API token
- `GET /projects/{id}/runtime/logs` — With an API token
- `POST /projects/{id}/runtime/restart` — With an API token
- `POST /projects/{id}/runtime/stop` — With an API token
- `GET /projects/{id}/seo` — With an API token
- `POST /projects/{id}/seo/advice` — With an API token
- `GET /projects/{id}/shot/{deploy}` — With an API token
- `POST /projects/{id}/source` — With an API token
- `GET /projects/{id}/source.zip` — With an API token
- `DELETE /projects/{id}/status-badge` — Browser session only
- `GET /projects/{id}/status-badge` — Browser session only
- `POST /projects/{id}/status-badge` — Browser session only
- `GET /projects/{id}/storage` — With an API token
- `POST /projects/{id}/storage` — With an API token
- `DELETE /projects/{id}/storage/{sid}` — Browser session only
- `GET /projects/{id}/template-fields` — With an API token
- `PUT /projects/{id}/template-fields` — With an API token
- `GET /projects/{id}/traffic` — With an API token
- `GET /projects/{id}/traffic/top` — With an API token
- `GET /projects/{id}/vitals` — With an API token
- `GET /projects/{id}/vitals/settings` — With an API token
- `PUT /projects/{id}/vitals/settings` — With an API token
- `DELETE /projects/{id}/volume` — Browser session only
- `GET /projects/{id}/volume` — With an API token
- `PUT /projects/{id}/volume` — With an API token
- `GET /projects/{id}/volume/backups` — With an API token
- `GET /projects/{id}/volume/backups/{snap}/download` — With an API token
- `POST /projects/{id}/volume/backups/{snap}/restore` — With an API token
- `PUT /projects/{id}/wait-for-ci` — With an API token
- `GET /projects/address` — With an API token
- `GET /projects/by-slug/{slug}` — With an API token

## /stacks

- `GET /stacks` — With an API token
- `POST /stacks` — With an API token
- `DELETE /stacks/{stack}` — Browser session only
- `GET /stacks/{stack}` — With an API token
- `PATCH /stacks/{stack}` — With an API token
- `POST /stacks/{stack}/environments` — With an API token
- `DELETE /stacks/{stack}/environments/{env}` — Browser session only
- `GET /stacks/{stack}/environments/{env}/variables` — With an API token
- `PUT /stacks/{stack}/environments/{env}/variables` — Browser session only
- `POST /stacks/{stack}/merge` — With an API token
- `PUT /stacks/{stack}/previews` — With an API token
- `POST /stacks/{stack}/rewire` — With an API token
- `POST /stacks/{stack}/services` — With an API token
- `POST /stacks/{stack}/wire` — With an API token
- `POST /stacks/plan` — With an API token

## /storage

- `GET /storage` — With an API token
- `GET /storage/{sid}` — With an API token
- `GET /storage/{sid}/cors` — With an API token
- `PUT /storage/{sid}/cors` — Browser session only
- `GET /storage/{sid}/download` — With an API token
- `POST /storage/{sid}/folders` — Browser session only
- `GET /storage/{sid}/keys` — With an API token
- `POST /storage/{sid}/keys/rotate` — Browser session only
- `GET /storage/{sid}/lifecycle` — With an API token
- `PUT /storage/{sid}/lifecycle` — Browser session only
- `DELETE /storage/{sid}/objects` — Browser session only
- `GET /storage/{sid}/objects` — With an API token
- `POST /storage/{sid}/objects/delete` — Browser session only
- `GET /storage/{sid}/peek` — With an API token
- `PUT /storage/{sid}/public` — Browser session only
- `PUT /storage/{sid}/tier` — Browser session only
- `POST /storage/{sid}/uploads` — Browser session only
- `GET /storage/{sid}/usage` — With an API token

## /teams

- `GET /teams` — With an API token
- `POST /teams` — Browser session only
- `DELETE /teams/{slug}` — Browser session only
- `PATCH /teams/{slug}` — Browser session only
- `GET /teams/{slug}/databases/quote` — With an API token
- `GET /teams/{slug}/events` — With an API token
- `GET /teams/{slug}/members` — With an API token
- `DELETE /teams/{slug}/members/{member}` — Browser session only
- `PATCH /teams/{slug}/members/{member}` — Browser session only
- `GET /teams/{slug}/webhooks` — Browser session only
- `POST /teams/{slug}/webhooks` — Browser session only
- `DELETE /teams/{slug}/webhooks/{hook}` — Browser session only

## /templates

- `GET /templates` — With an API token
- `GET /templates/{name}/source.zip` — With an API token
- `GET /templates/repo-targets` — With an API token
- `GET /templates/source-repo` — With an API token

## /traffic

- `GET /traffic` — With an API token

## /uploads

- `POST /uploads` — Browser session only
- `GET /uploads/{id}` — With an API token
- `POST /uploads/zip` — Browser session only

## /vcs

- `DELETE /vcs/{provider}` — Browser session only
- `GET /vcs/{provider}/folders` — With an API token
- `GET /vcs/{provider}/repo` — With an API token
- `GET /vcs/{provider}/repos` — With an API token
