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

# Approve or deny a pending approval

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

Submits an approval decision for a paused execution awaiting human-in-the-loop approval.

Reference: https://docs.runtype.com/api-reference/runtype-api/dispatch/approve-or-deny-a-pending-approval

## Authentication

- `Authorization` header (bearer token, required) — API key or Clerk session token

## 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)
- `decision` (enum, required)
  - Allowed values: `approved`, `denied`
- `executionId` (string, required)
- `streamResponse` (false, required)
- `reason` (string, optional)
- `remember` (boolean, optional)

## Response

### 200

- `DispatchApproveJsonResponse`
  - DispatchApprovalContinuationJsonResponse: DispatchApprovalContinuationJsonResponse
  - DispatchDetachedApprovalJsonResponse: DispatchDetachedApprovalJsonResponse

## Errors

### 400 Bad Request Error

Validation error

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 401 Unauthorized Error

Unauthorized

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 402 Payment Required Error

Platform key spend limit exceeded

- `decision` (enum, required)
  - Allowed values: `approved`, `denied`
- `executionId` (string, required)
- `status` (enum, required)
  - Allowed values: `completed`, `paused`, `failed`
- `success` (boolean, required)
- `blockReason` (string, optional)
- `code` (string, optional)
- `error` (string, optional)
- `pausedReason` (DispatchPausedReason, optional)
- `upgradeUrl` (string, optional)

### 403 Forbidden Error

Insufficient permissions

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 404 Not Found Error

Paused execution not found

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 409 Conflict Error

Execution is not awaiting this approval or cannot be resumed here

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 410 Gone Error

The paused execution was armed by the retired legacy flow engine and cannot be resumed (LEGACY_PAUSE_UNRESUMABLE); re-run the flow

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 500 Internal Server Error

Internal server error

- `code` (string, required) — Stable error code: `INTERNAL_ERROR` unless the route documents its own.
- `error` (string, required)
- `details` (list of InternalErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.
- `message` (string, optional) — Plain-language guidance: retry, then contact support with the `requestId`.
- `requestId` (string, optional) — The `X-Runtype-Request-ID` of the failed request, for support.

## Types

### DispatchApprovalContinuationJsonResponse

- `decision` (enum, required)
  - Allowed values: `approved`, `denied`
- `executionId` (string, required)
- `status` (enum, required)
  - Allowed values: `completed`, `paused`, `failed`
- `success` (boolean, required)
- `blockReason` (string, optional)
- `code` (string, optional)
- `error` (string, optional)
- `pausedReason` (DispatchPausedReason, optional)
- `upgradeUrl` (string, optional)

### DispatchDetachedApprovalJsonResponse

- `approvalId` (string, required)
- `executionId` (string, required)
- `status` (enum, required)
  - Allowed values: `running`

### 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, …).

### DispatchPausedReason

- DispatchPausedReason0
- DispatchPausedReason1
- DispatchPausedReason2

### InternalErrorDetailsItems

- `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, …).

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

## Examples

**Request**

```json
{
  "approvalId": "appr_xyz789",
  "decision": "approved",
  "executionId": "exec_abc123def456",
  "streamResponse": true,
  "reason": "Tool execution verified and safe to proceed"
}
```

**SDK Code**

```python Approve Execution
import requests

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

payload = {
    "approvalId": "appr_xyz789",
    "decision": "approved",
    "executionId": "exec_abc123def456",
    "streamResponse": True,
    "reason": "Tool execution verified and safe to proceed"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Approve Execution
const url = 'https://api.runtype.com/v1/dispatch/approve';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"approvalId":"appr_xyz789","decision":"approved","executionId":"exec_abc123def456","streamResponse":true,"reason":"Tool execution verified and safe to proceed"}'
};

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

```go Approve Execution
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"approvalId\": \"appr_xyz789\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_abc123def456\",\n  \"streamResponse\": true,\n  \"reason\": \"Tool execution verified and safe to proceed\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 Execution
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"approvalId\": \"appr_xyz789\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_abc123def456\",\n  \"streamResponse\": true,\n  \"reason\": \"Tool execution verified and safe to proceed\"\n}"

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

```java Approve Execution
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.runtype.com/v1/dispatch/approve")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"approvalId\": \"appr_xyz789\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_abc123def456\",\n  \"streamResponse\": true,\n  \"reason\": \"Tool execution verified and safe to proceed\"\n}")
  .asString();
```

```php Approve Execution
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/dispatch/approve', [
  'body' => '{
  "approvalId": "appr_xyz789",
  "decision": "approved",
  "executionId": "exec_abc123def456",
  "streamResponse": true,
  "reason": "Tool execution verified and safe to proceed"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Approve Execution
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/dispatch/approve");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"approvalId\": \"appr_xyz789\",\n  \"decision\": \"approved\",\n  \"executionId\": \"exec_abc123def456\",\n  \"streamResponse\": true,\n  \"reason\": \"Tool execution verified and safe to proceed\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve Execution
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "approvalId": "appr_xyz789",
  "decision": "approved",
  "executionId": "exec_abc123def456",
  "streamResponse": true,
  "reason": "Tool execution verified and safe to proceed"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/dispatch/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()
```