---
title: "Approval of AI agent actions — API v1 and MCP | Nodea documentation"
description: "Cost and destructive API v1 and MCP actions need a human approval: the 202 approval_required answer, status polling, request statuses, who approves and the event journal."
url: "https://nodea.io/en/api-docs/approvals"
lang: "en"
updated: "2026-11-18"
---

# Approval of AI agent actions — API v1 and MCP | Nodea documentation

> An AI agent never performs cost or destructive actions on its own: it gets an approval request, a person approves it in the panel and the agent polls the status. The list of actions, the answer format, endpoints and MCP tools.

An AI agent — every REST API v1 token and every MCP connection, including OAuth with a client such as Claude, existing tokens and tokens used in CI — **never performs cost or destructive actions on its own**. It creates an **approval request** instead. The action is performed only after a person approves it in the panel (AI → Actions to approve). There are no exceptions for chosen tokens and there is no endpoint or tool that approves on a person's behalf.

**Breaking change (release of 13.11.2026):** the endpoints and tools in the table below now answer `202` with `code: approval_required` instead of performing the action. `202` is in the 2xx range — a script that only checks for a "successful" answer will treat the action as done. Check the `code` field and poll `status_url`.

## What needs an approval

- **Cost** — an instance order, a service plan change and any other action that generates a charge.
- **Destructive** — deleting a server or hosting, stopping a virtual machine, restoring a hosting backup, deleting a mailbox, deleting or overwriting a DNS record, changing a domain's nameservers, a domain transfer code, a firewall change with a DROP policy, removed rules, a new drop/reject rule or a changed address set, switching the firewall off, restoring firewall rules, committing a firewall migration, deleting an SSH key, revoking a vault device, revoking a share, executing or retrying a migration.
- **No approval** — reads and safe changes: starting and restarting a machine, snapshots, the SSH test, a note, installing components, saving a firewall draft, refreshing the firewall, adding an SSH key, new DNS records, changing a record's TTL, priority and comment, WHOIS privacy, hosting mail and backups (not restores), tickets, the profile, all monitoring and alerting.

An exception for ACME DNS-01 clients: deleting a TXT `_acme-challenge` record needs no approval (it is the clean-up after issuing a certificate). `dry_run: true` of a firewall change and of a plan change answers at once, since it changes nothing.

| Method | Endpoint | MCP tool | Type | Class | Who approves |
| --- | --- | --- | --- | --- | --- |
| POST | /api/v1/compute/orders | `compute-order-draft` | `compute.order` | cost | owner or a member with `orders` |
| POST | /api/v1/compute/order-drafts | `compute-order-draft` | `compute.order` | cost | owner or a member with `orders` |
| POST | /api/v1/services/{service}/upgrade | `service-upgrade` | `service.upgrade` | cost | owner or a member with `products` + `manageproducts` + `orders` |
| DELETE | /api/v1/servers/{server} | `server-delete` | `server.destroy` | destructive | account owner |
| POST | /api/v1/servers/{server}/vm/stop | `server-vm-stop` | `server.vm.stop` | destructive | owner or a member with `manageproducts` |
| POST | /api/v1/servers/{server}/firewall/apply | `server-firewall-apply` | `server.firewall.apply` | destructive | owner or a member with `manageproducts` |
| POST | /api/v1/servers/{server}/firewall/disable | `server-firewall-disable` | `server.firewall.disable` | destructive | owner or a member with `manageproducts` |
| POST | /api/v1/servers/{server}/firewall/drift/restore | — | `server.firewall.drift_restore` | destructive | owner or a member with `manageproducts` |
| POST | /api/v1/servers/{server}/firewall/migration/commit | `server-firewall-migration` | `server.firewall.migration_commit` | destructive | owner or a member with `manageproducts` |
| DELETE | /api/v1/dns/zones/{zone}/records/{record} | `dns-record-delete` | `dns.record.delete` | destructive | owner or a member with `managedomains` |
| DELETE | /api/v1/dns/zones/{zone}/records | — | `dns.record.delete` | destructive | owner or a member with `managedomains` |
| PATCH | /api/v1/dns/zones/{zone}/records/{record} | `dns-record-update` | `dns.record.update` | destructive | owner or a member with `managedomains` |
| POST | /api/v1/dns/zones/{zone}/import | `dns-zone-import` (`replace: true`) | `dns.zone.import_replace` | destructive | owner or a member with `managedomains` |
| PATCH | /api/v1/domains/{domain} | `domain-set-nameservers` | `domain.nameservers` | destructive | owner or a member with `domains` + `managedomains` |
| POST | /api/v1/domains/{domain}/epp | `domain-request-epp` | `domain.epp` | destructive | owner or a member with `domains` + `managedomains` |
| DELETE | /api/v1/hosting/{account} | `hosting-terminate` | `hosting.terminate` | destructive | account owner |
| POST | /api/v1/hosting/{account}/backups/{backup}/restore | `hosting-backup-restore` | `hosting.backup.restore` | destructive | account owner |
| DELETE | /api/v1/hosting/{account}/emails/{email} | `hosting-email-delete` | `hosting.email.delete` | destructive | owner or a member with `products` + `manageproducts` |
| DELETE | /api/v1/branding | `branding-delete` | `branding.delete` | destructive | owner or a member with `products` + `manageproducts` (server outside an account — the token user) |
| DELETE | /api/v1/servers/{server}/branding | `branding-delete` | `branding.delete` | destructive | owner or a member with `products` + `manageproducts` (server outside an account — the token user) |
| DELETE | /api/v1/servers/{server}/branding/domains/{host} | `branding-delete` | `branding.delete` | destructive | owner or a member with `products` + `manageproducts` (server outside an account — the token user) |
| DELETE | /api/v1/ssh-keys/{sshKey} | `ssh-key-delete` | `ssh_key.delete` | destructive | the token user (personal resource) |
| POST | /api/v1/ssh-keys/{sshKey}/propagate | `ssh-key-propagate` | `ssh_key.propagate` | destructive | the owner of the servers' account with MFA (one request per account; servers outside an account — the token user) |
| DELETE | /api/v1/ssh-keys/{sshKey}/servers/{server} | `ssh-key-server-remove` | `ssh_key.server_remove` | destructive | the token user (personal resource) with MFA |
| DELETE | /api/v1/vault-devices/{device} | `vault-device-revoke` | `vault_device.revoke` | destructive | the token user (personal resource) |
| DELETE | /api/v1/shares/{share} | `share-revoke` | `share.revoke` | destructive | the token user (personal resource) |
| POST | /api/v1/migrations/{run}/execute | `migration-execute` | `migration.execute` | destructive | the token user (personal resource) |
| POST | /api/v1/migrations/{run}/retry-failed | `migration-retry-failed` | `migration.retry_failed` | destructive | the token user (personal resource) |

## The answer with an approval request

Authentication, account permissions and validation work as always — errors (`401`, `403`, `404`, `409`, `422`, `423`) come back at once and no request is created. When the action is allowed, the answer is `202 Accepted` with the header `Retry-After: 30`:

```json
{
  "message": "This action needs a human approval. …",
  "code": "approval_required",
  "data": {
    "approval_request": {
      "id": "01jcz8m3w7v1t2n9q4r5s6t7u8",
      "status": "pending",
      "type": "server.destroy",
      "classification": "destructive",
      "subject": { "type": "App\\Models\\Server", "id": "42", "label": "web-01" },
      "effect": "Deletion of server web-01. …",
      "quote": null,
      "created_at": "2026-11-13T12:00:00+01:00",
      "expires_at": "2026-11-14T12:00:00+01:00",
      "decided_at": null,
      "decided_by_human": false,
      "executed_at": null,
      "result": null,
      "approve_url": "https://app.nodea.io/app/ai/approvals/01jcz8m3w7v1t2n9q4r5s6t7u8",
      "status_url": "https://app.nodea.io/api/v1/approval-requests/01jcz8m3w7v1t2n9q4r5s6t7u8",
      "poll_after_seconds": 30
    }
  }
}
```

- `approve_url` — the request page in the panel. Give it to the person.
- `quote` — the quote of a cost action (net); the person sees the same amount when approving. When the price changes before the execution, the execution fails with `quote_changed` and a new approval is needed.
- `expires_at` — a request is valid for **24 hours**, then it becomes `expired`.
- The same action with the same parameters repeated by the same user while it waits returns the existing request with `200`. The `Idempotency-Key` header (up to 64 characters `A-Za-z0-9._:-`) always returns the same request for the same key.

Over MCP the tool returns a normal result (not an error) with `code: approval_required`, a `message` with instructions for the agent and an `approval_request` of the same shape.

## Request statuses

- `pending` — waits for a person's decision.
- `approved`, `executing` — approved, the platform performs the action in the background.
- `succeeded` — done; `result.ids` holds the identifiers from the answer (e.g. `task_id`, `revision`, `operation_id`), `result.order_id` the order.
- `failed` — the execution failed; `result.error_code` gives the reason (e.g. the endpoint's error code, `approval_mismatch` when the resource changed since the approval, `quote_changed`, `token_revoked`, `approver_lost_permission`).
- `rejected`, `expired`, `cancelled` — nothing was done.

At execution the platform repeats the agent's call with the same token in the same account: the token scope, the account permissions, the locks and the resource state are checked again. Revoking the token before the decision cancels the request. The agent never learns who decided — it sees only `decided_by_human: true`.

## Approval request endpoints

They work with any token scope. A personal access token sees only the requests it created; an OAuth client (e.g. an MCP connection from Claude) sees the requests of its connection, also after its access token was refreshed. Anything else answers `404`.

| Method | Endpoint | Scope | Description |
| --- | --- | --- | --- |
| GET | /api/v1/approval-requests | any | The token's requests, newest first. Parameters: `status` (one of the statuses), `per_page` (1–50, default 20). Answer: `data[]` and `meta` (`current_page`, `last_page`, `per_page`, `total`). |
| GET | /api/v1/approval-requests/{id} | any | Status of one request (the same shape as in the `202` answer). Poll every `poll_after_seconds` (header `Retry-After`). |
| POST | /api/v1/approval-requests/{id}/cancel | any | Withdraw your own `pending` request. A request already decided — `409` with `code: approval_not_pending`. |

MCP tools (transport scope `mcp:use`, no other scope):

| Tool | Description |
| --- | --- |
| `approval-requests-list` | Requests of this connection (optional `status`), at most 50. |
| `approval-request-get` | Status of one request (`id`). |
| `approval-request-cancel` | Withdraw a `pending` request (`id`); otherwise the error `(code: approval_not_pending)`. |

## Who approves

A person approves in the panel, in a browser session: the account owner or a member holding the permission the action needs (table above). Deleting a server with a virtual machine, deleting hosting and restoring a hosting backup is approved by the owner only. SSH keys, vault devices, shares and migrations belong to the user — the token user approves them. A destructive action is approved by typing the resource name. Deleting a server (`server.destroy`) additionally needs a one-time code from the e-mail; when the account MFA policy does not allow the e-mail code, it is confirmed with a TOTP code or a passkey, never the password. One confirmation covers one approval. A Nodea administrator sees the requests but does not approve them. Notifications: an item in the "Waiting" section, a counter in the menu, an e-mail and a browser notification.

## Approval event journal

Every request and every decision goes into a journal that cannot be changed or deleted and is never cleaned up automatically: creation (token, MCP client, user, IP address, HTTP client, parameters, quote), approval and rejection (who — name, e-mail and role at the time of the decision, IP address, confirmed resource name, reason), expiry, cancellation and the execution result. Entries are linked with a SHA-256 hash. The journal with filters and a CSV export is in the panel (AI → Actions to approve → Journal).

## Example — an agent deletes a server

```bash
# 1. The agent asks for the deletion
curl -s -X DELETE https://app.nodea.io/api/v1/servers/42 \
  -H "Authorization: Bearer $NODEA_TOKEN" -H "Accept: application/json"
# HTTP 202 — code: approval_required, data.approval_request.id = 01jcz8…

# 2. A person approves in the panel (approve_url), typing "web-01"

# 3. The agent polls the status
curl -s https://app.nodea.io/api/v1/approval-requests/01jcz8m3w7v1t2n9q4r5s6t7u8 \
  -H "Authorization: Bearer $NODEA_TOKEN" -H "Accept: application/json"
# { "data": { "status": "succeeded", "result": { "success": true, … }, … } }
```

## Related

- [Nodea API v1 — introduction: base URL, tokens, scopes, limits | Nodea](https://nodea.io/en/api-docs/overview)
- [Nodea MCP server — endpoint, authentication, OAuth discovery, tools | Nodea](https://nodea.io/en/api-docs/mcp)
- [Deploying from AI coding agents — Claude Code, Codex, OpenCode and CI | Nodea](https://nodea.io/en/api-docs/ai-coding-agents)
- [Servers — API v1 and MCP | Nodea Documentation](https://nodea.io/en/api-docs/servers)

---

Languages: [pl](https://nodea.pl/pl/dokumentacja-api/approvals.md)  
Site index: [llms.txt](https://nodea.io/en/llms.txt)
