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

> ## Agent Instructions
> H Platform has three products: the Agents API (managed computer-use agents, base URL https://agp.eu.hcompany.ai/api/v2 or https://agp.hcompany.ai/api/v2 for the US), the Models API (OpenAI-compatible Holo vision-language models at https://api.hcompany.ai/v1), and HoloTab (a free no-code Chrome extension that runs Holo in the user's browser, with recordable routines and schedules). The `holo` CLI (`pip install "hai-agents[cli]"`) runs Agents API agents from a terminal, drives the user's own desktop with `-a h/holo-desktop`, and serves coding agents through `holo mcp`.
> Authenticate with a bearer API key from the HAI_API_KEY environment variable. SDKs: `pip install hai-agents` (Python, `from hai_agents import Client`) and `npm install hai-agents` (TypeScript, `import { HaiAgentsClient } from "hai-agents"`). CLI: `holo`.
> Agents do work in a browser or on a desktop; describe the task as an imperative instruction. To run a task quickly, prefer the pre-built agent `h/web-surfer-flash`. Read results from the session's `latest_answer` after it reaches a terminal status.
> Sessions are the unit of work; wait for a terminal status (completed, failed, timed_out, interrupted) before reading the answer. Use webhooks or the `changes` long-poll endpoint to follow progress.

# Send tool approvals

> Approve or deny the tool calls the agent holds for a human decision.

## Behavior

A held tool call waits on `awaiting_tool_results` and is listed in [`pending_approvals`](https://hub.hcompany.ai/agents-api/sessions/status#param-pending-approvals) until you approve or deny it. An approved call runs exactly once; an approved [custom tool](https://hub.hcompany.ai/agents-api/custom-tools.md) call then moves to `pending_tool_calls` for you to run. A denied call is refused, and the rest of its step is skipped.

Each decision is reported as a `ToolApprovalDecidedEvent`. Deciding a call on a `paused` session leaves it paused, so [resume](https://hub.hcompany.ai/agents-api/sessions/resume.md) it separately.

## Path parameters

**id** `string` *required*

The session ID.

## Request body

Send either a single decision or a batch, discriminated by `type`.

### Decision

**type** `string` (default: tool\_approval\_response)

`"tool_approval_response"`.

**call\_id** `string` *required*

The held call's `tool_req.id`, from `pending_approvals`.

**action** `string` *required*

`"approve"` runs the call and the rest of its step. `"deny"` refuses it and skips the rest.

**message** `string | null`

Why the call is denied, as the model reads it. Up to 2,000 characters. Send files or images as a [user message](https://hub.hcompany.ai/agents-api/sessions/send-messages.md).

### Batch

**type** `string` *required*

`"batch"`.

**responses** `object[]` *required*

At least one decision.

## Response

`202 Accepted`.

```python Python theme={"system"}
from hai_agents import Client, SendSessionToolApprovalsRequestBody_ToolApprovalResponse

client = Client()

client.sessions.send_session_tool_approvals(
    session_id,
    request=SendSessionToolApprovalsRequestBody_ToolApprovalResponse(call_id="call_1", action="approve"),
)
```

```typescript TypeScript theme={"system"}
import { HaiAgentsClient } from "hai-agents";

const client = new HaiAgentsClient();

await client.sessions.sendSessionToolApprovals({
  id: sessionId,
  body: { type: "tool_approval_response", callId: "call_1", action: "approve" },
});
```

```bash cURL theme={"system"}
curl -X POST https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/tool_approvals \
  -H "Authorization: Bearer $HAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "tool_approval_response", "call_id": "call_1", "action": "approve"}'
```

## More examples

### Decide a batch of calls

```python Python theme={"system"}
from hai_agents import Client, SendSessionToolApprovalsRequestBody_Batch, ToolApprovalResponseEvent

client = Client()

client.sessions.send_session_tool_approvals(
    session_id,
    request=SendSessionToolApprovalsRequestBody_Batch(
        responses=[
            ToolApprovalResponseEvent(call_id="call_1", action="approve"),
            ToolApprovalResponseEvent(call_id="call_2", action="deny", message="Do not email customers."),
        ],
    ),
)
```

```typescript TypeScript theme={"system"}
import { HaiAgentsClient } from "hai-agents";

const client = new HaiAgentsClient();

await client.sessions.sendSessionToolApprovals({
  id: sessionId,
  body: {
    type: "batch",
    responses: [
      { callId: "call_1", action: "approve" },
      { callId: "call_2", action: "deny", message: "Do not email customers." },
    ],
  },
});
```

```bash cURL theme={"system"}
curl -X POST https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/tool_approvals \
  -H "Authorization: Bearer $HAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "batch",
    "responses": [
      {"call_id": "call_1", "action": "approve"},
      {"call_id": "call_2", "action": "deny", "message": "Do not email customers."}
    ]
  }'
```

## Errors

| Status | Cause |
| - | - |
| `404` | Not found, or not in your organization. |
| `409` | The session already finished. Its held calls were decided when it ended. |
| `422` | Malformed request body. |


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