> ## 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 and each identity's approval rules — client.approvals.

Keys and MCP connections can read and wait on approvals (`approvals:read`, or `audit:read`). Deciding, and changing
rules, needs a signed-in person's session token; a key gets `403 forbidden`. Guide: [Approvals](https://vetta.sh/docs/developers/approvals.md)
and [Identities](https://vetta.sh/docs/developers/identities.md#approval-rules).

## list

```ts theme={"system"}
client.approvals.list(query?: { status?: "pending" | "approved" | "denied" | "expired" | "executed" | "failed"; identity?: string; limit?: number; after?: string }): Promise<ApprovalPage>
```

`GET /v1/approvals`. The page carries `total` for the filter.

## get

```ts theme={"system"}
client.approvals.get(id: string): Promise<Approval>
```

`GET /v1/approvals/{id}`.

## wait

```ts theme={"system"}
client.approvals.wait(id: string, options?: { timeoutMs?: number }): Promise<Approval>
```

`POST /v1/approvals/{id}/wait`, repeated until the approval is decided or `timeoutMs` (default 10 minutes) passes.
Returns the approval either way; check `status`.

## approve

```ts theme={"system"}
client.approvals.approve(id: string, body?: { note?: string }): Promise<Approval>
```

`POST /v1/approvals/{id}/approve`. Person session only. Runs the held call as its original credential and answers
`executed` or `failed` with `result`.

## deny

```ts theme={"system"}
client.approvals.deny(id: string, body?: { reason?: string }): Promise<Approval>
```

`POST /v1/approvals/{id}/deny`. Person session only.

## rules.get

```ts theme={"system"}
client.approvals.rules.get(identityId: string): Promise<ApprovalRules>
```

`GET /v1/identities/{id}/approval_rules`. The effective rules; each action says whether its `source` is the identity
or the workspace.

## rules.set

```ts theme={"system"}
client.approvals.rules.set(identityId: string, rules: Partial<Record<ApprovalAction, ApprovalRule>>): Promise<ApprovalRules>
```

`PUT /v1/identities/{id}/approval_rules`. Person session only. An action left out inherits the workspace default.

```ts theme={"system"}
await client.approvals.rules.set("idn_01JD7Q2R5T7V9X1Z3B5D7F9H1K", { "trade.place": { over_usd: 100 } });
```

## rules.workspace.get / rules.workspace.set

```ts theme={"system"}
client.approvals.rules.workspace.get(orgId: string): Promise<ApprovalRules>
client.approvals.rules.workspace.set(orgId: string, rules: Record<ApprovalAction, ApprovalRule>): Promise<ApprovalRules>
```

`GET /v1/organizations/{id}/approval_rules` and `PUT /v1/organizations/{id}/approval_rules` (person session only).

## Held calls

Methods that can be held take `approvals: "return" | "throw" | "wait"`. New namespaces default to `"return"` (the
`Approval` comes back); older namespaces default to `"throw"`, raising `ApprovalRequiredError` with `.approval`. Held
calls only happen in developer workspaces.


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