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

# Approvals

> Held calls wait for a person. See what is pending, approve or deny it, and let your agent wait for the answer.

When a call matches an identity's [approval rules](https://vetta.sh/docs/developers/identities.md#approval-rules), it is **held**: Naive does
not run it, and answers `202` with an **approval**. A person approves or denies it; on approve, Naive runs the original
request once, as the original key, and records the result.

In the console, **Approvals** has two lists: **Pending** and **History**. "Change what asks first" takes you to the
identity's rules.

## The approval object

**id** `string`

`apr_…`

**object** `string`

Always `approval`.

**status** `string`

`pending`, `approved`, `denied`, `expired`, `executed` (approved and run) or `failed` (approved, but the run failed or the key no longer allows it).

**action** `string`

The rule's action, e.g. `domain.buy`, `trade.place`.

**summary** `string`

A one-line description, e.g. "Buy acme-labs.com for \$12.00".

**identity\_id** `string | null`

The identity the call was for, or `null` for a workspace resource.

**amount\_micro\_usd** `integer | null`

The amount the rule was checked against.

**request** `object`

`{ method, path, body_redacted }` — what will run. Message text and other sensitive fields are redacted.

**credential** `object`

`{ kind: "key" | "mcp", id, name }` — who asked.

**rule** `object`

`{ source: "identity" | "workspace", value }` — the rule that held it.

**decided\_by** `object | null`

`{ id, email }` of the person who decided.

**decided\_at** `string | null`

When it was decided.

**note** `string | null`

The approver's note or the denial reason.

**result** `object | null`

After an approved run: `{ status, body, request_id }` — the response the original call would have returned.

**expires\_at** `string`

A pending approval expires 24 hours after it is created and is then never run.

**created\_at** `string`

When the call was held.

```json theme={"system"}
{
  "object": "approval",
  "id": "apr_01JD7R0K2M4P6R8T0V2X4Z6B8D",
  "status": "pending",
  "action": "domain.buy",
  "summary": "Buy acme-labs.com for $12.00",
  "identity_id": null,
  "amount_micro_usd": 12000000,
  "request": { "method": "POST", "path": "/v1/domains/purchase", "body_redacted": { "domain": "acme-labs.com" } },
  "credential": { "kind": "key", "id": "key_01JD7P9H1K3M5P7R9T1V3X5Z7B", "name": "research-agent" },
  "rule": { "source": "workspace", "value": "always" },
  "decided_by": null,
  "decided_at": null,
  "note": null,
  "result": null,
  "expires_at": "2026-12-02T10:00:00Z",
  "created_at": "2026-12-01T10:00:00Z"
}
```

A key or connection can have at most 50 pending approvals at once.

## List approvals

`GET /v1/approvals` — scope `approvals:read` (a key with `audit:read` also works). Filter with `?status=` and
`?identity=`. The page includes `total`, the count for the filter (the console's badge).

## Get one approval

`GET /v1/approvals/{id}` — scope `approvals:read`. Also available to MCP clients as `approvals_get`.

## Wait for a decision

`POST /v1/approvals/{id}/wait` — scope `approvals:read`. A long poll: it answers as soon as the approval is decided, or
after `timeout_ms` (at most 25000) with the approval still `pending`. Call it again to keep waiting. MCP clients use
`approvals_wait`.

**timeout\_ms** `integer`

How long to wait, up to 25000 milliseconds.

## Approve or deny

`POST /v1/approvals/{id}/approve` (body `{ "note"?: string }`) and `POST /v1/approvals/{id}/deny` (body
`{ "reason"?: string }`). **People only**: a signed-in owner or admin. Keys and MCP connections are refused with
`403 forbidden`, so an agent cannot approve its own request.

The console calls these for you. From your own back office, a person's session token can call
`client.approvals.approve(id, { note })` and `client.approvals.deny(id, { reason })`.

Approve runs the original request. If the key was revoked, expired or narrowed in the meantime, the approval ends
`failed` instead. The run uses the approval id as its idempotency key, so it can never run twice.

## Handling a held call in your code

```ts TypeScript theme={"system"}
// A held call answered with an approval; wait for a person to decide.
const res = await client.approvals.wait("apr_01JD7R0K2M4P6R8T0V2X4Z6B8D", { timeoutMs: 600_000 });
if (res.status === "executed") console.log(res.result);
```

```bash curl theme={"system"}
curl -X POST https://api.vetta.sh/v1/approvals/apr_01JD7R0K2M4P6R8T0V2X4Z6B8D/wait \
  -H "Authorization: Bearer $NAIVE_API_KEY" -H "Content-Type: application/json" \
  -d '{ "timeout_ms": 25000 }'
```

`client.tools.run` returns the approval by default; pass
`approvals: "wait"` to block until it is decided, or `approvals: "throw"` to get an `ApprovalRequiredError` carrying
`.approval`. Older SDK namespaces throw `ApprovalRequiredError`. Held calls only happen in developer workspaces, so
existing integrations never see one.

## Notifications and webhooks

Owners and admins can be emailed when an approval is requested; the setting is in **Settings**. Subscribe a webhook
explicitly to `approval.requested` and `approval.decided` to get `{ approval_id, action, identity_id, status }`. See
[Webhooks](https://vetta.sh/docs/developers/webhooks.md).

## From the CLI

```bash theme={"system"}
naive approvals list --status pending
naive approvals show apr_01JD7R0K2M4P6R8T0V2X4Z6B8D
naive approvals wait apr_01JD7R0K2M4P6R8T0V2X4Z6B8D --timeout 10m
```


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