# Approve a tool call

Approve the exact pending invocation and let its execution continue.

`POST https://api.smallworld.sh/api/v1/tool-approvals/:id/approve`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| id | path | UUID | Yes | The pending tool-call ID from toolCalls or the tool-approvals list. |
| remember | body | boolean | No | Defaults to false. true saves an Allow override for this user and tool across Worlds; list and remove it with /users/:userId/tool-policies. It never shows a tool hidden for the workspace or the World, or an integration that is turned off, and it has no effect in sessions of a group that sets its own policy for the tool. |

## Request examples

### curl

```curl
curl --fail-with-body -X POST 'https://api.smallworld.sh/api/v1/tool-approvals/b5212df0-ea8b-4eb8-a7b1-057ff45b3044/approve' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### typescript

```typescript
const response = await fetch("https://api.smallworld.sh/api/v1/tool-approvals/b5212df0-ea8b-4eb8-a7b1-057ff45b3044/approve", {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
```

### python

```python
response = requests.post(
    "https://api.smallworld.sh/api/v1/tool-approvals/b5212df0-ea8b-4eb8-a7b1-057ff45b3044/approve",
    headers={"Authorization": f"Bearer {api_key}"},
    json={},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Responses

Returns one tool call: id, sessionId, executionId, your userId, worldId, integration (its key), integrationName, account, connectionSource, group, toolName, toolDescription, toolLabel (read, write, destructive, or unknown), exact arguments, status, nullable result/error/errorCode, reason, hooks, nullable providerApproval, and timestamps. integrationName, account, connectionSource, group, toolDescription, and toolLabel are copied when the call is made, so an approval shows the call as it was requested, also after its group is renamed or deleted; they are null for calls recorded before they were kept, and account is null without a connection. connectionSource is personal for the user's own account, group for the account of the session's group, or none for a tool without a connection. group is the group the call's session acted for when the call was made, with your id and its name, or null in a groupless session. reason says why tool call hooks denied the call or asked for approval, and hooks lists each hook's answer (scope, status, reason, durationMs, failure). providerApproval is present only while a provider prompt is pending and contains id, message, question, and choices, each with value and label. Use that id for the provider decision endpoint and render the offered choices. completedAt and decidedAt may be null. Statuses include pending, approved, denied, running, completed, failed, expired, interrupted, and unknown.

### 200 · Approved

The exact invocation was approved. The provider result is not yet available; read the execution to continue.

```json
{
  "id": "b5212df0-ea8b-4eb8-a7b1-057ff45b3044",
  "sessionId": "01995e57-0501-76b8-b797-5b24df5b307f",
  "executionId": "01995e57-3027-7557-a233-009ea3dcd8fc",
  "userId": "customer_123",
  "worldId": "01995e56-e2d4-7f19-b691-7bf9af6abdc8",
  "integration": "acme",
  "integrationName": "Acme",
  "account": null,
  "connectionSource": "none",
  "group": null,
  "toolName": "get_order",
  "toolDescription": "Read an order by its ID.",
  "toolLabel": "read",
  "arguments": {
    "orderId": "order_456"
  },
  "status": "approved",
  "result": null,
  "error": null,
  "errorCode": null,
  "reason": null,
  "providerApproval": null,
  "hooks": [],
  "createdAt": "2026-10-10T12:00:00.000Z",
  "expiresAt": "2026-10-10T12:15:00.000Z",
  "completedAt": null,
  "decidedAt": "2026-10-10T12:00:01.000Z"
}
```

### 200 · Running

Repeating the same approval without remember returns the saved call, which may have progressed to this state. It never dispatches the provider twice.

```json
{
  "id": "b5212df0-ea8b-4eb8-a7b1-057ff45b3044",
  "sessionId": "01995e57-0501-76b8-b797-5b24df5b307f",
  "executionId": "01995e57-3027-7557-a233-009ea3dcd8fc",
  "userId": "customer_123",
  "worldId": "01995e56-e2d4-7f19-b691-7bf9af6abdc8",
  "integration": "acme",
  "integrationName": "Acme",
  "account": null,
  "connectionSource": "none",
  "group": null,
  "toolName": "get_order",
  "toolDescription": "Read an order by its ID.",
  "toolLabel": "read",
  "arguments": {
    "orderId": "order_456"
  },
  "status": "running",
  "result": null,
  "error": null,
  "errorCode": null,
  "reason": null,
  "providerApproval": null,
  "hooks": [],
  "createdAt": "2026-10-10T12:00:00.000Z",
  "expiresAt": "2026-10-10T12:15:00.000Z",
  "completedAt": null,
  "decidedAt": "2026-10-10T12:00:01.000Z"
}
```

### 200 · Completed

Repeating the same approval without remember returns the saved call, which may have progressed to this state. It never dispatches the provider twice.

```json
{
  "id": "b5212df0-ea8b-4eb8-a7b1-057ff45b3044",
  "sessionId": "01995e57-0501-76b8-b797-5b24df5b307f",
  "executionId": "01995e57-3027-7557-a233-009ea3dcd8fc",
  "userId": "customer_123",
  "worldId": "01995e56-e2d4-7f19-b691-7bf9af6abdc8",
  "integration": "acme",
  "integrationName": "Acme",
  "account": null,
  "connectionSource": "none",
  "group": null,
  "toolName": "get_order",
  "toolDescription": "Read an order by its ID.",
  "toolLabel": "read",
  "arguments": {
    "orderId": "order_456"
  },
  "status": "completed",
  "result": {
    "orderId": "order_456",
    "status": "shipped"
  },
  "error": null,
  "errorCode": null,
  "reason": null,
  "providerApproval": null,
  "hooks": [],
  "createdAt": "2026-10-10T12:00:00.000Z",
  "expiresAt": "2026-10-10T12:15:00.000Z",
  "completedAt": "2026-10-10T12:00:01.000Z",
  "decidedAt": "2026-10-10T12:00:01.000Z"
}
```

### 200 · Failed

Repeating the same approval without remember returns the saved call, which may have progressed to this state. It never dispatches the provider twice.

```json
{
  "id": "b5212df0-ea8b-4eb8-a7b1-057ff45b3044",
  "sessionId": "01995e57-0501-76b8-b797-5b24df5b307f",
  "executionId": "01995e57-3027-7557-a233-009ea3dcd8fc",
  "userId": "customer_123",
  "worldId": "01995e56-e2d4-7f19-b691-7bf9af6abdc8",
  "integration": "acme",
  "integrationName": "Acme",
  "account": null,
  "connectionSource": "none",
  "group": null,
  "toolName": "get_order",
  "toolDescription": "Read an order by its ID.",
  "toolLabel": "read",
  "arguments": {
    "orderId": "order_456"
  },
  "status": "failed",
  "result": null,
  "error": "order_not_found: No order belongs to this user.",
  "errorCode": "order_not_found",
  "reason": null,
  "providerApproval": null,
  "hooks": [],
  "createdAt": "2026-10-10T12:00:00.000Z",
  "expiresAt": "2026-10-10T12:15:00.000Z",
  "completedAt": "2026-10-10T12:00:01.000Z",
  "decidedAt": "2026-10-10T12:00:01.000Z"
}
```

### 400

invalid_request: The body is invalid. It may only contain remember.

#### invalid_request

The body is invalid. It may only contain remember.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "Approval decisions may only include remember"
}
```

### 401

authentication_required: The Authorization header is missing or empty. invalid_api_key: The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

#### authentication_required

The Authorization header is missing or empty.

```json
{
  "statusCode": 401,
  "code": "authentication_required",
  "message": "Authentication is required"
}
```

#### invalid_api_key

The API key is invalid or revoked, or the header doesn't use the Bearer scheme.

```json
{
  "statusCode": 401,
  "code": "invalid_api_key",
  "message": "The API key is invalid or revoked"
}
```

### 403

ip_not_allowed: The request came from an address outside the workspace's IP allowlist.

#### ip_not_allowed

The request came from an address outside the workspace's IP allowlist.

```json
{
  "statusCode": 403,
  "code": "ip_not_allowed",
  "message": "The source IP address is not allowed by this account's security settings"
}
```

### 404

approval_not_found: The tool approval does not exist in your workspace.

#### approval_not_found

The tool approval does not exist in your workspace.

```json
{
  "statusCode": 404,
  "code": "approval_not_found",
  "message": "Tool approval not found"
}
```

### 409

approval_expired: The tool approval has expired. approval_interrupted: The call was interrupted before it was decided, such as by an API restart, a change to its integration or connection, the user being moved out of the group whose connection it used, or its session being closed. The message says why. approval_already_processed: The invocation has already been decided differently, or it already finished. provider_approval_required: The pending call is waiting for a provider choice. Read its providerApproval and submit an offered choice to the provider decision endpoint. approval_policy_denied: The tool is now hidden by policy, or its integration is turned off. The call stays pending; deny it or let it expire.

#### approval_expired

The tool approval has expired.

```json
{
  "statusCode": 409,
  "code": "approval_expired",
  "message": "Approval is expired"
}
```

#### approval_interrupted

The call was interrupted before it was decided, such as by an API restart, a change to its integration or connection, the user being moved out of the group whose connection it used, or its session being closed. The message says why.

```json
{
  "statusCode": 409,
  "code": "approval_interrupted",
  "message": "The tool call was interrupted: API restarted; submit a new command"
}
```

#### approval_already_processed

The invocation has already been decided differently, or it already finished.

```json
{
  "statusCode": 409,
  "code": "approval_already_processed",
  "message": "Approval was already decided"
}
```

#### provider_approval_required

The pending call is waiting for a provider choice. Read its providerApproval and submit an offered choice to the provider decision endpoint.

```json
{
  "statusCode": 409,
  "code": "provider_approval_required",
  "message": "This call is waiting for a provider approval. Submit one of the provider choices."
}
```

#### approval_policy_denied

The tool is now hidden by policy, or its integration is turned off. The call stays pending; deny it or let it expire.

```json
{
  "statusCode": 409,
  "code": "approval_policy_denied",
  "message": "This tool is now hidden by policy, so this tool call can't be approved. Deny it or let the approval expire."
}
```

### 413

request_too_large: The JSON body is larger than 12 MiB. File uploads count toward it, base64 or escaping included.

#### request_too_large

The JSON body is larger than 12 MiB. File uploads count toward it, base64 or escaping included.

```json
{
  "statusCode": 413,
  "code": "request_too_large",
  "message": "The request body is larger than 12 MiB."
}
```

### 415

unsupported_media_type: The request has a body that isn't JSON. Send JSON with Content-Type: application/json, or no body at all.

#### unsupported_media_type

The request has a body that isn't JSON. Send JSON with Content-Type: application/json, or no body at all.

```json
{
  "statusCode": 415,
  "code": "unsupported_media_type",
  "message": "Send the request body as JSON with Content-Type: application/json."
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

```json
{
  "statusCode": 500,
  "code": "internal_error",
  "message": "Internal server error"
}
```

## Notes

- Omit the body or send {} to approve only this call. Arguments cannot be changed through the approval endpoint.

- Use this endpoint while providerApproval is null or absent. A provider prompt requires its own offered choice through /tool-approvals/:id/provider/:approvalId.

- Present the integration, tool, and recorded arguments to the user before approving. The returned approval is not the provider's final result; poll the execution for completion.

- Repeating the same decision without remember returns the stored call and does not dispatch a second provider call. Repeating a decision with remember: true returns a conflict.

- If the tool was hidden or its integration turned off after the call was made, approval returns approval_policy_denied and the call stays pending. Deny it or let it expire.

- Approving a mount's changes saves them, unless someone else changed a file they touch in the meantime; the execution's mountChanges says which. remember is ignored for them: a mount's settings live only on the mount. Editing or deleting the mount, or the user losing it, while its changes wait interrupts the approval, and approving then returns approval_interrupted.
