# List tool approvals

List pending approvals or tool-call history, optionally scoped to a session or execution.

`GET https://api.smallworld.sh/api/v1/tool-approvals`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| sessionId | query | UUID | No | Limit results to this session. An unknown session returns 404. |
| executionId | query | UUID | No | Limit results to this execution. An unknown execution returns 404. |
| pendingOnly | query | boolean | No | true returns pending calls only; false includes history. Defaults to true. Pass the string true or false in the URL. |

## Request examples

### curl

```curl
curl --fail-with-body -X GET 'https://api.smallworld.sh/api/v1/tool-approvals?executionId=01995e57-3027-7557-a233-009ea3dcd8fc' \
  -H "Authorization: Bearer $SMALLWORLD_API_KEY"
```

### typescript

```typescript
const response = await fetch("https://api.smallworld.sh/api/v1/tool-approvals?executionId=01995e57-3027-7557-a233-009ea3dcd8fc", {
  method: "GET",
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
```

### python

```python
response = requests.get(
    "https://api.smallworld.sh/api/v1/tool-approvals?executionId=01995e57-3027-7557-a233-009ea3dcd8fc",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Responses

Returns items, without a pagination cursor. 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 · Pending

A recorded invocation is awaiting the user's decision. This is the default pendingOnly=true result.

```json
{
  "items": [
    {
      "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": "pending",
      "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": null
    }
  ]
}
```

### 200 · Approved

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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 · Denied

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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": "denied",
      "result": null,
      "error": "Tool call denied",
      "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

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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"
    }
  ]
}
```

### 200 · Expired

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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": "expired",
      "result": null,
      "error": "Approval expired",
      "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:15:00.000Z",
      "decidedAt": null
    }
  ]
}
```

### 200 · Interrupted

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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": "interrupted",
      "result": null,
      "error": "API restarted; submit a new command",
      "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": null
    }
  ]
}
```

### 200 · Unknown

Tool-call history can include this state when pendingOnly=false. The execution may contain other tool calls in different states.

```json
{
  "items": [
    {
      "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": "unknown",
      "result": null,
      "error": "API restarted during a provider call; verify the remote result before retrying",
      "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 · Hook asked

A tool call hook asked for approval of a call whose tool policy is Allow. reason carries the hook's reason, to show to the person who decides.

```json
{
  "items": [
    {
      "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": "pending",
      "result": null,
      "error": null,
      "errorCode": null,
      "reason": "Order belongs to an enterprise account",
      "providerApproval": null,
      "hooks": [
        {
          "scope": "integration",
          "status": "ask",
          "reason": "Order belongs to an enterprise account",
          "durationMs": 84,
          "failure": null
        }
      ],
      "createdAt": "2026-10-10T12:00:00.000Z",
      "expiresAt": "2026-10-10T12:15:00.000Z",
      "completedAt": null,
      "decidedAt": null
    }
  ]
}
```

### 200 · Provider approval

The provider is awaiting a decision. Render its offered choices and submit the selected value with the current providerApproval.id.

```json
{
  "items": [
    {
      "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": "gmail",
      "integrationName": "Gmail",
      "account": "support@example.com",
      "connectionSource": "group",
      "group": {
        "id": "team_42",
        "name": "Support team"
      },
      "toolName": "trash_thread",
      "toolDescription": "Move a conversation to Trash.",
      "toolLabel": "destructive",
      "arguments": {
        "threadId": "thread_456"
      },
      "status": "pending",
      "result": null,
      "error": null,
      "errorCode": null,
      "reason": null,
      "providerApproval": {
        "id": "69b8aa84-bcbd-4f8b-833c-f414760d9449",
        "message": "This operation requires your permission.",
        "question": "Allow this operation?",
        "choices": [
          {
            "value": "ALLOW_ONCE",
            "label": "Allow once"
          },
          {
            "value": "DENY_ONCE",
            "label": "Deny once"
          }
        ]
      },
      "hooks": [],
      "createdAt": "2026-10-10T12:00:00.000Z",
      "expiresAt": "2026-10-10T12:15:00.000Z",
      "completedAt": null,
      "decidedAt": null
    }
  ]
}
```

### 200 · Hook denied

A tool call hook denied the call. The agent got the same error, with the hook's reason.

```json
{
  "items": [
    {
      "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": "denied",
      "result": null,
      "error": "Tool call denied by hook: This order belongs to another customer",
      "errorCode": "hook_denied",
      "reason": "This order belongs to another customer",
      "providerApproval": null,
      "hooks": [
        {
          "scope": "integration",
          "status": "deny",
          "reason": "This order belongs to another customer",
          "durationMs": 84,
          "failure": null
        }
      ],
      "createdAt": "2026-10-10T12:00:00.000Z",
      "expiresAt": "2026-10-10T12:15:00.000Z",
      "completedAt": "2026-10-10T12:00:01.000Z",
      "decidedAt": null
    }
  ]
}
```

### 200 · Empty

No calls match the filters; this includes a session with no pending approvals.

```json
{
  "items": []
}
```

### 400

invalid_request: A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

#### invalid_request

A parameter is invalid; the message names the problem. Unknown query parameters are rejected.

```json
{
  "statusCode": 400,
  "code": "invalid_request",
  "message": "Unknown query parameter: color"
}
```

### 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

session_not_found: The supplied session does not exist in your workspace. execution_not_found: The supplied execution does not exist in your workspace.

#### session_not_found

The supplied session does not exist in your workspace.

```json
{
  "statusCode": 404,
  "code": "session_not_found",
  "message": "Session not found"
}
```

#### execution_not_found

The supplied execution does not exist in your workspace.

```json
{
  "statusCode": 404,
  "code": "execution_not_found",
  "message": "Execution not found"
}
```

### 500

internal_error: An unexpected server error.

#### internal_error

An unexpected server error.

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

## Notes

- Each approval identifies one invocation with its exact arguments. A single execution can produce multiple pending approvals.

- A pending call with providerApproval is waiting for the provider's decision. Display its message, question, and every choice label, and submit the chosen value with its providerApproval.id. This prompt can follow a local approval on the same tool-call ID. Use the regular approve and deny endpoints when providerApproval is null or absent.

- Tool approvals use the workspace's approval timeout: 15 minutes by default, configurable from 5 minutes to 1 month (30 days) in Settings → Terminal. Use each call's expiresAt to display its deadline. Approval waits pause the one-hour execution limit.

- Changes to a mount whose setting is ask arrive here too, as one approval per changed mount at the end of the command: integration is mounts, integrationName is Mounts, toolName is the mount's ID, toolDescription is its path followed by its description, toolLabel is write or destructive, and arguments has the mount's path and its changes with diffs. A move between two mounts is one approval for both.
