> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runtype.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runtype.com/_mcp/server.

# Answer an end-user approval gate

POST https://api.runtype.com/v1/client/approve
Content-Type: application/json

Session-authenticated approval for browser client-token sessions. Answers a paused approval whose gate the agent authored with `tools.approval.approver: 'end-user'`, then streams the continued run over Server-Sent Events in the same shape as `/v1/client/resume`. The decision is bound to the session that started the turn, single-use, and bound to the exact reviewed tool parameters; visitors cannot create persistent "always allow" grants. A gate with the default `owner` approver is refused with `403 APPROVAL_APPROVER_NOT_END_USER`; answer those with `POST /v1/dispatch/approve`. Does not count against execution limits.

Reference: https://docs.runtype.com/api-reference/runtype-api/client-runtime/answer-an-end-user-approval-gate

## Servers

- `https://api.runtype.com` (Production, default)
- `https://api.runtype-staging.com` (Staging)

## Request

### Body (application/json)

This endpoint expects an object.

- `approvalId` (string, required) — The `approvalId` from the `approval_start` event this decision answers.
- `decision` (enum, required)
  - Allowed values: `approved`, `denied`
- `executionId` (string, required)
- `sessionId` (string, required)
- `streamResponse` (false, required)
- `assistantMessageId` (string, optional) — Id for the assistant message this resumed leg produces, so a re-send deduplicates by id. Optional; same contract as `/v1/client/resume`.
- `reason` (string, optional) — The visitor's own note on the decision, recorded with it. Optional.

## Response

### 200

- `events` (list of ExecutionStreamEvent, required)
- `executionId` (string, required)
- `status` (enum, required)
  - Allowed values: `completed`, `paused`, `failed`
- `success` (boolean, required)
- `agentTargetResolution` (enum, optional) — How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
  - Allowed values: `alias`, `version`, `legacy-live-row`
- `agentVersionId` (string, optional) — The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists.
- `alias` (string, optional) — The release alias (for example `live`) the version was resolved through, when one was.
- `blockReason` (string, optional)
- `code` (string, optional)
- `error` (string, optional)
- `pausedReason` (DispatchPausedReason, optional)
- `upgradeUrl` (string, optional)

## Errors

### 400 Bad Request Error

Validation error, or the approvalId does not match the pending approval

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 401 Unauthorized Error

Session not found or expired

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 403 Forbidden Error

Client token inactive, origin mismatch, execution belongs to another session, or the gate needs the owner (`APPROVAL_APPROVER_NOT_END_USER`)

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 404 Not Found Error

No paused execution found for the executionId, or the approval expired

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 409 Conflict Error

The approval was already resolved (`APPROVAL_ALREADY_RESOLVED`)

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 500 Internal Server Error

Internal server error

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

### 503 Service Unavailable Error

Neutral service-unavailable response when the owner platform-key spend limit blocks an end-user continuation

- `error` (string, required)
- `details` (list of ErrorDetailsItems, optional)

## Types

### ExecutionStreamEvent

### DispatchPausedReason

### ErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

### ExecutionStreamEvent0

- `executionId` (string, required)
- `kind` (enum, required)
  - Allowed values: `agent`, `flow`
- `seq` (double, required)
- `startedAt` (string, required)
- `type` (enum, required)
  - Allowed values: `execution_start`
- `agentId` (string, optional)
- `agentName` (string, optional)
- `config` (map from string to any, optional)
- `flowId` (string, optional)
- `flowName` (string, optional)
- `maxTurns` (double, optional)
- `resumed` (boolean, optional)
- `source` (string, optional)
- `totalSteps` (double, optional)

### ExecutionStreamEvent1

- `executionId` (string, required)
- `kind` (enum, required)
  - Allowed values: `agent`, `flow`
- `seq` (double, required)
- `success` (boolean, required)
- `type` (enum, required)
  - Allowed values: `execution_complete`
- `claudeManagedAgentId` (string, optional)
- `completedAt` (string, optional)
- `durationMs` (double, optional)
- `externalAgent` (ExecutionStreamEventOneOf1ExternalAgent, optional)
- `failedSteps` (double, optional)
- `finalOutput` (string, optional)
- `iterations` (double, optional)
- `outcome` (enum, optional) — How the execution ended: `completed`, `error`, or `aborted` (cancelled, interrupted, or superseded by the caller or host). Absent on frames from older producers: treat `execution_error` as `error` and `execution_complete` as `completed`, or `error` when `success` is false.
  - Allowed values: `completed`, `error`, `aborted`
- `stepErrorCount` (double, optional)
- `stopReason` (string, optional)
- `successfulSteps` (double, optional)
- `totalCost` (double, optional)
- `totalSteps` (double, optional)
- `totalTokens` (ExecutionStreamEventOneOf1TotalTokens, optional)
- `totalTokensUsed` (double, optional)

### ExecutionStreamEvent2

- `error` (ExecutionStreamEventOneOf2Error, required)
- `executionId` (string, required)
- `kind` (enum, required)
  - Allowed values: `agent`, `flow`
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `execution_error`
- `blockReason` (string, optional)
- `code` (string, optional)
- `completedAt` (string, optional)
- `finalOutput` (string, optional)
- `outcome` (enum, optional) — How the execution ended: `completed`, `error`, or `aborted` (cancelled, interrupted, or superseded by the caller or host). Absent on frames from older producers: treat `execution_error` as `error` and `execution_complete` as `completed`, or `error` when `success` is false.
  - Allowed values: `completed`, `error`, `aborted`
- `stopReason` (string, optional)
- `upgradeUrl` (string, optional)

### ExecutionStreamEvent3

- `executionId` (string, required)
- `id` (string, required)
- `role` (enum, required)
  - Allowed values: `user`, `assistant`, `system`
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `turn_start`
- `iteration` (double, optional)
- `subagent` (ExecutionStreamEventOneOf3Subagent, optional)
- `turnIndex` (double, optional)

### ExecutionStreamEvent4

- `executionId` (string, required)
- `id` (string, required)
- `role` (enum, required)
  - Allowed values: `user`, `assistant`, `system`
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `turn_complete`
- `attributes` (map from string to ExecutionStreamEventOneOf4Attributes, optional)
- `completedAt` (string, optional)
- `content` (string, optional)
- `cost` (double, optional)
- `estimatedContextBreakdown` (ExecutionStreamEventOneOf4EstimatedContextBreakdown, optional)
- `fallback` (ExecutionStreamEventOneOf4Fallback, optional)
- `iteration` (double, optional)
- `stopReason` (enum, optional)
  - Allowed values: `end_turn`, `max_tool_calls`, `length`, `content_filter`, `error`, `unknown`
- `subagent` (ExecutionStreamEventOneOf4Subagent, optional)
- `tokens` (ExecutionStreamEventOneOf4Tokens, optional)

### ExecutionStreamEvent5

- `executionId` (string, required)
- `id` (string, required)
- `ordinal` (integer, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `model_call_start`
- `iteration` (double, optional)
- `model` (string, optional)
- `provider` (string, optional)
- `startedAt` (string, optional)
- `stepId` (string, optional)
- `subagent` (ExecutionStreamEventOneOf5Subagent, optional)
- `turnId` (string, optional)

### ExecutionStreamEvent6

- `executionId` (string, required)
- `id` (string, required)
- `ordinal` (integer, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `model_call_complete`
- `attributes` (map from string to ExecutionStreamEventOneOf6Attributes, optional)
- `completedAt` (string, optional)
- `cost` (double, optional)
- `durationMs` (double, optional)
- `finishReason` (string, optional)
- `iteration` (double, optional)
- `model` (string, optional)
- `provider` (string, optional)
- `responseModel` (string, optional)
- `subagent` (ExecutionStreamEventOneOf6Subagent, optional)
- `success` (boolean, optional)
- `tokens` (ExecutionStreamEventOneOf6Tokens, optional)
- `turnId` (string, optional)

### ExecutionStreamEvent7

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `step_start`
- `index` (double, optional)
- `name` (string, optional)
- `outputVariable` (string, optional)
- `startedAt` (string, optional)
- `stepType` (string, optional)
- `subagent` (ExecutionStreamEventOneOf7Subagent, optional)
- `totalSteps` (double, optional)

### ExecutionStreamEvent8

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `step_complete`
- `completedAt` (string, optional)
- `cost` (double, optional)
- `durationMs` (double, optional)
- `error` (string, optional)
- `fallback` (ExecutionStreamEventOneOf8Fallback, optional)
- `name` (string, optional)
- `result` (any, optional)
- `stepType` (string, optional)
- `stopReason` (enum, optional)
  - Allowed values: `end_turn`, `max_tool_calls`, `length`, `content_filter`, `error`, `unknown`
- `subagent` (ExecutionStreamEventOneOf8Subagent, optional)
- `success` (boolean, optional)
- `tokensUsed` (double, optional)
- `unresolvedVariables` (list of string, optional)

### ExecutionStreamEvent9

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `step_skip`
- `index` (double, optional)
- `name` (string, optional)
- `skippedAt` (string, optional)
- `stepType` (string, optional)
- `totalSteps` (double, optional)
- `when` (string, optional)

### ExecutionStreamEvent10

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `text_start`
- `parentToolCallId` (string, optional)
- `role` (enum, optional)
  - Allowed values: `user`, `assistant`, `system`
- `stepId` (string, optional)
- `subagent` (ExecutionStreamEventOneOf10Subagent, optional)
- `turnId` (string, optional)

### ExecutionStreamEvent11

- `delta` (string, required)
- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `text_delta`
- `subagent` (ExecutionStreamEventOneOf11Subagent, optional)

### ExecutionStreamEvent12

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `text_complete`
- `subagent` (ExecutionStreamEventOneOf12Subagent, optional)
- `text` (string, optional)

### ExecutionStreamEvent13

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `reasoning_start`
- `parentToolCallId` (string, optional)
- `scope` (enum, optional)
  - Allowed values: `turn`, `loop`
- `subagent` (ExecutionStreamEventOneOf13Subagent, optional)

### ExecutionStreamEvent14

- `delta` (string, required)
- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `reasoning_delta`
- `subagent` (ExecutionStreamEventOneOf14Subagent, optional)

### ExecutionStreamEvent15

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `reasoning_complete`
- `scope` (enum, optional)
  - Allowed values: `turn`, `loop`
- `subagent` (ExecutionStreamEventOneOf15Subagent, optional)
- `text` (string, optional)

### ExecutionStreamEvent16

- `executionId` (string, required)
- `id` (string, required)
- `mediaType` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `media_start`
- `role` (enum, optional)
  - Allowed values: `user`, `assistant`, `system`
- `toolCallId` (string, optional)

### ExecutionStreamEvent17

- `delta` (string, required)
- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `media_delta`

### ExecutionStreamEvent18

- `executionId` (string, required)
- `id` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `media_complete`
- `data` (string, optional)
- `mediaType` (string, optional)
- `toolCallId` (string, optional)
- `url` (string, optional)

### ExecutionStreamEvent19

- `artifactType` (enum, required)
  - Allowed values: `markdown`, `component`
- `id` (string, required)
- `type` (enum, required)
  - Allowed values: `artifact_start`
- `component` (string, optional)
- `executionId` (string, optional)
- `file` (ExecutionStreamEventOneOf19File, optional)
- `seq` (double, optional)
- `title` (string, optional)

### ExecutionStreamEvent20

- `delta` (string, required)
- `id` (string, required)
- `type` (enum, required)
  - Allowed values: `artifact_delta`
- `executionId` (string, optional)
- `seq` (double, optional)

### ExecutionStreamEvent21

- `component` (string, required)
- `id` (string, required)
- `props` (map from string to any, required)
- `type` (enum, required)
  - Allowed values: `artifact_update`
- `executionId` (string, optional)
- `seq` (double, optional)

### ExecutionStreamEvent22

- `id` (string, required)
- `type` (enum, required)
  - Allowed values: `artifact_complete`
- `executionId` (string, optional)
- `seq` (double, optional)

### ExecutionStreamEvent23

- `executionId` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `source`
- `id` (string, optional)
- `sourceType` (string, optional)
- `title` (string, optional)
- `url` (string, optional)

### ExecutionStreamEvent24

- `executionId` (string, required)
- `seq` (double, required)
- `state` (map from string to any, required)
- `type` (enum, required)
  - Allowed values: `state_snapshot`
- `iteration` (double, optional)

### ExecutionStreamEvent25

- `executionId` (string, required)
- `patch` (list of ExecutionStreamEventOneOf25PatchItems, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `state_delta`
- `iteration` (double, optional)

### ExecutionStreamEvent26

- `executionId` (string, required)
- `seq` (double, required)
- `toolCallId` (string, required)
- `toolName` (string, required)
- `toolType` (string, required)
- `type` (enum, required)
  - Allowed values: `tool_start`
- `annotations` (ExecutionStreamEventOneOf26Annotations, optional)
- `hiddenParameterNames` (list of string, optional)
- `iteration` (double, optional)
- `origin` (enum, optional)
  - Allowed values: `webmcp`, `sdk`
- `pageOrigin` (string, optional)
- `parameters` (map from string to any, optional)
- `startedAt` (string, optional)
- `stepId` (string, optional)
- `subagent` (ExecutionStreamEventOneOf26Subagent, optional)

### ExecutionStreamEvent27

- `delta` (string, required)
- `executionId` (string, required)
- `seq` (double, required)
- `toolCallId` (string, required)
- `type` (enum, required)
  - Allowed values: `tool_input_delta`
- `subagent` (ExecutionStreamEventOneOf27Subagent, optional)

### ExecutionStreamEvent28

- `executionId` (string, required)
- `parameters` (map from string to any, required)
- `seq` (double, required)
- `toolCallId` (string, required)
- `type` (enum, required)
  - Allowed values: `tool_input_complete`
- `hiddenParameterNames` (list of string, optional)
- `subagent` (ExecutionStreamEventOneOf28Subagent, optional)
- `toolName` (string, optional)

### ExecutionStreamEvent29

- `delta` (string, required)
- `executionId` (string, required)
- `seq` (double, required)
- `toolCallId` (string, required)
- `type` (enum, required)
  - Allowed values: `tool_output_delta`

### ExecutionStreamEvent30

- `executionId` (string, required)
- `seq` (double, required)
- `success` (boolean, required)
- `toolCallId` (string, required)
- `type` (enum, required)
  - Allowed values: `tool_complete`
- `error` (string, optional)
- `executionTime` (double, optional)
- `iteration` (double, optional)
- `result` (any, optional)
- `stepId` (string, optional)
- `subagent` (ExecutionStreamEventOneOf30Subagent, optional)
- `toolCost` (double, optional)
- `toolName` (string, optional)

### ExecutionStreamEvent31

- `approvalId` (string, required)
- `executionId` (string, required)
- `seq` (double, required)
- `toolName` (string, required)
- `type` (enum, required)
  - Allowed values: `approval_start`
- `description` (string, optional)
- `externalAgent` (ExecutionStreamEventOneOf31ExternalAgent, optional)
- `iteration` (double, optional)
- `parameters` (map from string to any, optional)
- `reason` (string, optional)
- `startedAt` (string, optional)
- `subagent` (ExecutionStreamEventOneOf31Subagent, optional)
- `timeout` (double, optional)
- `toolCallId` (string, optional)
- `toolType` (string, optional)

### ExecutionStreamEvent32

- `approvalId` (string, required)
- `decision` (enum, required)
  - Allowed values: `approved`, `denied`, `timeout`
- `executionId` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `approval_complete`
- `completedAt` (string, optional)
- `resolvedBy` (enum, optional)
  - Allowed values: `user`, `system`

### ExecutionStreamEvent33

- `executionId` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `await`
- `annotations` (ExecutionStreamEventOneOf33Annotations, optional)
- `awaitReason` (string, optional)
- `awaitedAt` (string, optional)
- `crawlId` (string, optional)
- `elicitation` (ExecutionStreamEventOneOf33Elicitation, optional)
- `externalAgent` (ExecutionStreamEventOneOf33ExternalAgent, optional)
- `origin` (enum, optional)
  - Allowed values: `webmcp`, `sdk`
- `pageOrigin` (string, optional)
- `parameters` (map from string to any, optional)
- `stepId` (string, optional)
- `toolCallId` (string, optional)
- `toolId` (string, optional)
- `toolName` (string, optional)

### ExecutionStreamEvent34

- `error` (ExecutionStreamEventOneOf34Error, required)
- `executionId` (string, required)
- `seq` (double, required)
- `type` (enum, required)
  - Allowed values: `error`
- `recoverable` (boolean, optional)

### ExecutionStreamEvent35

- `epoch` (integer, required)
- `executionId` (string, required)
- `kind` (enum, required)
  - Allowed values: `compaction`
- `phase` (enum, required)
  - Allowed values: `start`, `complete`
- `reason` (enum, required)
  - Allowed values: `threshold`, `overflow`, `manual`, `surface_policy`, `provider_mismatch`
- `seq` (double, required)
- `strategy` (enum, required)
  - Allowed values: `provider_native`, `summary`
- `tier` (integer, required)
- `type` (enum, required)
  - Allowed values: `context_notice`
- `outcome` (enum, optional)
  - Allowed values: `ok`, `failed`, `gap`, `skipped`
- `tokensAfter` (double, optional)
- `tokensBefore` (double, optional)

### ExecutionStreamEvent36

- `executionId` (string, required)
- `seq` (double, required)
- `timestamp` (string, required)
- `type` (enum, required)
  - Allowed values: `ping`

### ExecutionStreamEvent37

- `name` (string, required)
- `type` (enum, required)
  - Allowed values: `custom`
- `executionId` (string, optional)
- `seq` (double, optional)
- `value` (any, optional)

### DispatchPausedReason0

- `executionId` (string, required)
- `parameters` (map from string to any, required)
- `toolId` (string, required)
- `toolName` (string, required)
- `type` (enum, required)
  - Allowed values: `local_action`
- `approvalId` (string, optional)
- `awaitReason` (string, optional)
- `elicitation` (map from string to any, optional)

### DispatchPausedReason1

- `type` (enum, required)
  - Allowed values: `crawl_pending`
- `crawlId` (string, optional)
- `stepId` (string, optional)

### DispatchPausedReason2

- `type` (enum, required)
  - Allowed values: `durable_poll`
- `stepId` (string, optional)

### ExecutionStreamEventOneOf1ExternalAgent

- `contextId` (string, optional)
- `taskId` (string, optional)

### ExecutionStreamEventOneOf1TotalTokens

- `input` (double, required)
- `output` (double, required)

### ExecutionStreamEventOneOf2Error

### ExecutionStreamEventOneOf3Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf4Attributes

### ExecutionStreamEventOneOf4EstimatedContextBreakdown

- `categories` (map from string to ExecutionStreamEventOneOf4EstimatedContextBreakdownCategories, required)
- `estimatedTotalTokens` (double, required)
- `contextWindowSize` (double, optional)
- `estimatedUtilizationPercent` (double, optional)

### ExecutionStreamEventOneOf4Fallback

- `attempts` (list of ExecutionStreamEventOneOf4FallbackAttemptsItems, required)
- `exhausted` (boolean, required)
- `used` (boolean, required)
- `model` (string, optional)
- `reason` (string, optional, nullable)

### ExecutionStreamEventOneOf4Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf4Tokens

- `input` (double, required)
- `output` (double, required)

### ExecutionStreamEventOneOf5Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf6Attributes

### ExecutionStreamEventOneOf6Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf6Tokens

- `input` (double, required)
- `output` (double, required)
- `cacheRead` (double, optional)
- `cacheWrite` (double, optional)
- `reasoning` (double, optional)

### ExecutionStreamEventOneOf7Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf8Fallback

- `attempts` (list of ExecutionStreamEventOneOf8FallbackAttemptsItems, required)
- `exhausted` (boolean, required)
- `used` (boolean, required)
- `model` (string, optional)
- `reason` (string, optional, nullable)

### ExecutionStreamEventOneOf8Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf10Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf11Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf12Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf13Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf14Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf15Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf19File

- `mimeType` (string, required)
- `path` (string, required)
- `language` (string, optional)

### ExecutionStreamEventOneOf25PatchItems

- `op` (enum, required)
  - Allowed values: `add`, `remove`, `replace`, `move`, `copy`, `test`
- `path` (string, required)
- `from` (string, optional)
- `value` (any, optional)

### ExecutionStreamEventOneOf26Annotations

- `consequentialHint` (boolean, optional)
- `debugging` (boolean, optional)
- `destructiveHint` (boolean, optional)
- `idempotentHint` (boolean, optional)
- `openWorldHint` (boolean, optional)
- `readOnlyHint` (boolean, optional)
- `untrustedContentHint` (boolean, optional)

### ExecutionStreamEventOneOf26Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf27Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf28Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf30Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf31ExternalAgent

- `contextId` (string, optional)
- `taskId` (string, optional)

### ExecutionStreamEventOneOf31Subagent

- `toolName` (string, required)
- `agentName` (string, optional)
- `parentToolCallId` (string, optional)

### ExecutionStreamEventOneOf33Annotations

- `consequentialHint` (boolean, optional)
- `debugging` (boolean, optional)
- `destructiveHint` (boolean, optional)
- `idempotentHint` (boolean, optional)
- `openWorldHint` (boolean, optional)
- `readOnlyHint` (boolean, optional)
- `untrustedContentHint` (boolean, optional)

### ExecutionStreamEventOneOf33Elicitation

- `message` (string, required)
- `mode` (enum, required)
  - Allowed values: `form`, `url`
- `pauseCount` (double, optional)
- `requestedSchema` (map from string to any, optional)
- `requests` (list of ExecutionStreamEventOneOf33ElicitationRequestsItems, optional)
- `serverName` (string, optional)
- `url` (string, optional)

### ExecutionStreamEventOneOf33ExternalAgent

- `contextId` (string, optional)
- `taskId` (string, optional)

### ExecutionStreamEventOneOf34Error

### ExecutionStreamEventOneOf2Error1

- `code` (string, required)
- `message` (string, required)
- `details` (map from string to any, optional)

### ExecutionStreamEventOneOf4EstimatedContextBreakdownCategories

- `chars` (double, required)
- `estimatedTokens` (double, required)

### ExecutionStreamEventOneOf4FallbackAttemptsItems

- `attempt` (double, required)
- `success` (boolean, required)
- `type` (enum, required)
  - Allowed values: `retry`, `model`, `message`, `flow`
- `error` (string, optional)
- `model` (string, optional)

### ExecutionStreamEventOneOf8FallbackAttemptsItems

- `attempt` (double, required)
- `success` (boolean, required)
- `type` (enum, required)
  - Allowed values: `retry`, `model`, `message`, `flow`
- `error` (string, optional)
- `model` (string, optional)

### ExecutionStreamEventOneOf33ElicitationRequestsItems

- `message` (string, required)
- `mode` (enum, required)
  - Allowed values: `form`, `url`
- `name` (string, required)
- `requestedSchema` (map from string to any, optional)
- `url` (string, optional)

### ExecutionStreamEventOneOf34Error1

- `code` (string, required)
- `message` (string, required)
- `details` (map from string to any, optional)

## Examples

**Request**

```json
{
  "approvalId": "apr_01jq8z6k2re9v0w1m3n5p7s9t3",
  "decision": "approved",
  "executionId": "exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8",
  "sessionId": "cs_01jq8z6k2re9v0w1m3n5p7s9t2",
  "streamResponse": false
}
```

**SDK Code**

```python Approve the pending tool call
import requests

url = "https://api.runtype.com/v1/client/approve"

payload = {
    "approvalId": "apr_01jq8z6k2re9v0w1m3n5p7s9t3",
    "decision": "approved",
    "executionId": "exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8",
    "sessionId": "cs_01jq8z6k2re9v0w1m3n5p7s9t2",
    "streamResponse": False
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Approve the pending tool call
const url = 'https://api.runtype.com/v1/client/approve';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"approvalId":"apr_01jq8z6k2re9v0w1m3n5p7s9t3","decision":"approved","executionId":"exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8","sessionId":"cs_01jq8z6k2re9v0w1m3n5p7s9t2","streamResponse":false}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Approve the pending tool call
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.runtype.com/v1/client/approve"

	payload := strings.NewReader("{\n  \"approvalId\": \"apr_01jq8z6k2re9v0w1m3n5p7s9t3\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8\",\n  \"sessionId\": \"cs_01jq8z6k2re9v0w1m3n5p7s9t2\",\n  \"streamResponse\": false\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Approve the pending tool call
require 'uri'
require 'net/http'

url = URI("https://api.runtype.com/v1/client/approve")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"approvalId\": \"apr_01jq8z6k2re9v0w1m3n5p7s9t3\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8\",\n  \"sessionId\": \"cs_01jq8z6k2re9v0w1m3n5p7s9t2\",\n  \"streamResponse\": false\n}"

response = http.request(request)
puts response.read_body
```

```java Approve the pending tool call
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.runtype.com/v1/client/approve")
  .header("Content-Type", "application/json")
  .body("{\n  \"approvalId\": \"apr_01jq8z6k2re9v0w1m3n5p7s9t3\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8\",\n  \"sessionId\": \"cs_01jq8z6k2re9v0w1m3n5p7s9t2\",\n  \"streamResponse\": false\n}")
  .asString();
```

```php Approve the pending tool call
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/client/approve', [
  'body' => '{
  "approvalId": "apr_01jq8z6k2re9v0w1m3n5p7s9t3",
  "decision": "approved",
  "executionId": "exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8",
  "sessionId": "cs_01jq8z6k2re9v0w1m3n5p7s9t2",
  "streamResponse": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Approve the pending tool call
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/client/approve");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"approvalId\": \"apr_01jq8z6k2re9v0w1m3n5p7s9t3\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8\",\n  \"sessionId\": \"cs_01jq8z6k2re9v0w1m3n5p7s9t2\",\n  \"streamResponse\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve the pending tool call
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "approvalId": "apr_01jq8z6k2re9v0w1m3n5p7s9t3",
  "decision": "approved",
  "executionId": "exec_7b2e1d4c-9a3f-4e8b-b1c2-d3e4f5a6b7c8",
  "sessionId": "cs_01jq8z6k2re9v0w1m3n5p7s9t2",
  "streamResponse": false
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/client/approve")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```