> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.rightbrain.ai/v-1/llms.txt

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

# Approve Task Agent Approval Request

POST https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task-agent/{task_agent_id}/approval-request/{approval_request_id}/approve
Content-Type: application/json

Approve a pending human approval request.

Approving records the human decision and creates a bounded one-shot allowance
for the exact proposed tool call. Approval does not automatically execute the
agent; callers must invoke the explicit resume endpoint to continue the paused
run.

Reference: https://docs.rightbrain.ai/api-reference/api-reference/agents/approve-task-agent-approval-request

## Authentication

- `Authorization` header (bearer token, required) — API key or access token, sent as `Authorization: Bearer <token>`. The simplest option: create an API key in your dashboard under Settings, then paste it here.

## Servers

- `https://app.rightbrain.ai/api/v1` (Production, default)
- `https://app.rightbrain.ai/api/v1` (Staging API)
- `https://app.rblocal.dev/api/v1` (Local development)

## Request

### Path parameters

- `org_id` (string, required) — The organization ID
- `project_id` (string, required) — The project ID
- `task_agent_id` (string, required) — The task agent ID
- `approval_request_id` (string, required) — The approval request ID

### Body (application/json)

This endpoint expects a TaskAgentApprovalRequestApprove.

- `decision_note` (string, optional, nullable)
- `expires_at` (datetime, optional, nullable) — Optional shorter one-shot allowance expiry for a future resume path.

## Response

### 200

Task Agent approval request approved

- `id` (string, required)
- `project_id` (string, required)
- `task_agent_id` (string, required)
- `task_agent_revision_id` (string, required)
- `task_agent_run_id` (string, required)
- `session_id` (string, required)
- `adk_session_user_id` (string, required)
- `function_call_id` (string, required)
- `requested_by_actor_type` (enum, required) — Actor source that requested an approval-gated action.
  - Allowed values: `user`, `trigger`, `system`, `anonymous`
- `action_mode_snapshot` (string, required)
- `tool_type` (enum, required) — TaskAgent tool source categories for action controls.
  - Allowed values: `task`, `mcp`, `integration`, `registered_tool`
- `tool_name` (string, required)
- `tool_ref` (map from string to any, required)
- `tool_args_hash` (string, required)
- `status` (enum, required) — Lifecycle status for TaskAgent tool approval requests.
  - Allowed values: `pending`, `approved`, `rejected`, `expired`, `cancelled`
- `created` (string, required)
- `expires_at` (string, required)
- `invocation_id` (string, optional, nullable)
- `adk_event_id` (string, optional, nullable)
- `requested_by_user_id` (string, optional, nullable)
- `requested_by_actor_ref` (map from string to any, optional, nullable)
- `decided_by_user_id` (string, optional, nullable)
- `requester_is_decider` (boolean, optional, default: false)
- `tool_action_control_id` (string, optional, nullable)
- `tool_args_preview` (map from string to any, optional, nullable)
- `agent_reason` (string, optional, nullable) — Optional untrusted model-authored rationale, displayed as Agent reason.
- `decision` (enum, optional, nullable) — Human decision values for TaskAgent approval requests.
  - Allowed values: `approved`, `rejected`
- `decision_note` (string, optional, nullable)
- `modified` (string, optional, nullable)
- `decided_at` (string, optional, nullable)

## Errors

### 400 Bad Request Error

Bad Request - Invalid approval decision **Common causes:** - Invalid UUID format in path or query parameters - Missing required fields in the request body - Invalid enum value provided - Type mismatch (e.g., string instead of number) **Resolution:** Check the request body and parameters match the schema.

- `detail` (ErrorResponseDetail, required) — A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

### 401 Unauthorized Error

Unauthorized - Authentication failed **Common causes:** - Missing `Authorization` header - Expired access token - Invalid or malformed token - Using API key in wrong format **Resolution:** Ensure you're including a valid Bearer token or API key in the Authorization header.

- `detail` (ErrorResponseDetail, required) — A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

### 403 Forbidden Error

Forbidden - Insufficient permissions for task_agent **Common causes:** - Your role lacks the required permission for this action - The task_agent belongs to a different organization or project - The action requires admin or owner privileges **Resolution:** Contact your organization admin to request appropriate access.

- `ApproveTaskAgentApprovalRequestRequestForbiddenError`
  - PermissionCheckFailedErrorResponse: PermissionCheckFailedErrorResponse
  - MissingAuthenticationErrorResponse: MissingAuthenticationErrorResponse

### 404 Not Found Error

Approval request not found

- `detail` (ErrorResponseDetail, required) — A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

### 409 Conflict Error

Approval request is not pending

- `any`

### 422 Unprocessable Entity Error

Unprocessable Entity - Invalid request **Common causes:** - Request is well-formed but violates business rules - Invalid combination of fields (e.g., mutually exclusive options) - Referenced resource doesn't exist or is in wrong state - Field value is valid type but out of acceptable range **Resolution:** Check the error message for specific validation failures and adjust your request.

- `detail` (ErrorResponseDetail, required) — A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

### 500 Internal Server Error

Internal Server Error - Failed to approve Task Agent approval request

- `detail` (ErrorResponseDetail, required) — A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

## Types

### ErrorResponseDetail

A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

- string
- list of ErrorResponseDetailOneOf1Items
- ErrorResponseDetail2
- ErrorResponseDetail3
- ErrorResponseDetail4

### PermissionCheckFailedErrorResponse

- `detail` (PermissionCheckFailedErrorPayload, required) — The error payload.

### MissingAuthenticationErrorResponse

- `detail` (MissingAuthenticationErrorPayload, required) — The error payload.

### ErrorResponseDetailOneOf1Items

- `type` (string, required) — Error type identifier
- `loc` (list of ErrorResponseDetailOneOf1ItemsLocItems, optional) — Path to the error location. Integer segments index into a list.
- `msg` (string, optional) — Human-readable error message. Present on errors produced by FastAPI's own request validation.
- `message` (string, optional) — Human-readable error message. Used instead of `msg` by Rightbrain's own validators.

### ErrorResponseDetail2

Validation error returned by a service after request parsing, such as a Task clone dependency failure.

- `type` ("validation_error", required)
- `errors` (list of ErrorResponseDetailOneOf2ErrorsItems, required)

### ErrorResponseDetail3

Domain error raised via a brain.exc.BaseError subclass. The exact extra field name and shape vary by error type.

- `reason` (string, required) — Machine-readable, upper-snake-case error reason, e.g. RESOURCE_NOT_FOUND, PERMISSION_CHECK_FAILED, TAG_NAME_CONFLICT.
- `message` (string, required) — Human-readable error message

### ErrorResponseDetail4

Integration precondition failure. Uses `code` rather than `reason`, and carries no extra field. Raised by the Gmail trigger routes when the underlying integration is not authorized.

- `code` (string, required) — Machine-readable code, e.g. GMAIL_INTEGRATION_AUTH_REQUIRED.
- `message` (string, required) — Human-readable error message

### PermissionCheckFailedErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `PERMISSION_CHECK_FAILED`
- `permissionCheckFailedError` (PermissionCheckFailedErrorDetails, required) — Metadata detailing more information about the error.

### MissingAuthenticationErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `MISSING_AUTHENTICATION`
- `missingAuthenticationError` (EmptyErrorDetails, required) — Metadata detailing more information about the error.

### ErrorResponseDetailOneOf1ItemsLocItems

- string
- integer

### ErrorResponseDetailOneOf2ErrorsItems

- `type` (string, required) — Error type identifier
- `loc` (list of ErrorResponseDetailOneOf2ErrorsItemsLocItems, optional) — Path to the error location. Integer segments index into a list.
- `msg` (string, optional) — Human-readable error message. Present on errors produced by FastAPI's own request validation.
- `message` (string, optional) — Human-readable error message. Used instead of `msg` by Rightbrain's own validators.

### PermissionCheckFailedErrorDetails

- `permission` (string, required)
- `subject` (IAMObjectErrorDetails, optional, nullable)
- `resource` (IAMObjectErrorDetails, optional, nullable)

### EmptyErrorDetails

### ErrorResponseDetailOneOf2ErrorsItemsLocItems

- string
- integer

### IAMObjectErrorDetails

- `type` (string, required)
- `id` (string, optional, nullable)

## Examples

### Approve with no note

**Request**

```json
{}
```

**Response**

```json
{
  "id": "019fa2e2-2f00-71c7-aee7-539ab31cd302",
  "project_id": "0190a234-9876-5432-10ab-cdef01234567",
  "task_agent_id": "019df849-e106-3301-5894-291b4c9c6cab",
  "task_agent_revision_id": "019df849-e12a-b57e-62d4-0e5875e91ef4",
  "task_agent_run_id": "019fa2e2-2f00-7be2-bcf0-f056f44f700a",
  "session_id": "019fa2da-4790-7718-8edc-ae551b239242",
  "adk_session_user_id": "0190c234-1111-2222-3333-444444444444",
  "function_call_id": "call-4f19a7c3e8b2",
  "requested_by_actor_type": "user",
  "action_mode_snapshot": "require_approval",
  "tool_type": "integration",
  "tool_name": "sheets_spreadsheets_values_append",
  "tool_ref": {
    "integration_tool_id": "019df7a2-44a0-7923-9ea9-87be4ba93be9",
    "project_integration_id": "019df7a2-44a0-7a75-ae4f-4c8edcdac22e"
  },
  "tool_args_hash": "e3f1c9a7b2d4f6081a5c9e3d7b2f4a6081c5e9d3b7f2a4c6081e5d9c3b7f2a46",
  "status": "approved",
  "created": "2026-07-27T09:22:41Z",
  "expires_at": "2026-07-27T10:22:41Z",
  "invocation_id": "019fa2e2-2f00-7a54-9f70-cd49ad3571d2",
  "adk_event_id": "019fa2e2-2f00-77e0-a459-008f7d11e9f8",
  "requested_by_user_id": "0190c234-1111-2222-3333-444444444444",
  "decided_by_user_id": "019df7a2-44a0-7f54-8478-e19c351d1cc8",
  "requester_is_decider": false,
  "tool_action_control_id": "019fa2e2-2f00-7d54-ab2e-0fd98d058991",
  "tool_args_preview": {
    "range": "Tickets!A:D",
    "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
    "value_input_option": "USER_ENTERED",
    "values": [
      [
        "NJ-1042",
        "TCK-4821",
        "resolved",
        "2026-07-27"
      ]
    ]
  },
  "agent_reason": "The resolved support ticket must be recorded for follow-up.",
  "decision": "approved",
  "decision_note": "Approved — logging the resolved ticket is fine.",
  "modified": "2026-07-27T09:24:15Z",
  "decided_at": "2026-07-27T09:24:15Z"
}
```

**SDK Code**

```python Approve with no note
import requests

url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Approve with no note
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go Approve with no note
package main

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

func main() {

	url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve"

	payload := strings.NewReader("{}")

	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 with no note
require 'uri'
require 'net/http'

url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/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 = "{}"

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

```java Approve with no note
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php Approve with no note
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Approve with no note
using RestSharp;

var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve with no note
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/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()
```

### Approve with a decision note

**Request**

```json
{
  "decision_note": "Checked the recipient list; safe to send."
}
```

**Response**

```json
{
  "id": "019fa2e2-2f00-71c7-aee7-539ab31cd302",
  "project_id": "0190a234-9876-5432-10ab-cdef01234567",
  "task_agent_id": "019df849-e106-3301-5894-291b4c9c6cab",
  "task_agent_revision_id": "019df849-e12a-b57e-62d4-0e5875e91ef4",
  "task_agent_run_id": "019fa2e2-2f00-7be2-bcf0-f056f44f700a",
  "session_id": "019fa2da-4790-7718-8edc-ae551b239242",
  "adk_session_user_id": "0190c234-1111-2222-3333-444444444444",
  "function_call_id": "call-4f19a7c3e8b2",
  "requested_by_actor_type": "user",
  "action_mode_snapshot": "require_approval",
  "tool_type": "integration",
  "tool_name": "sheets_spreadsheets_values_append",
  "tool_ref": {
    "integration_tool_id": "019df7a2-44a0-7923-9ea9-87be4ba93be9",
    "project_integration_id": "019df7a2-44a0-7a75-ae4f-4c8edcdac22e"
  },
  "tool_args_hash": "e3f1c9a7b2d4f6081a5c9e3d7b2f4a6081c5e9d3b7f2a4c6081e5d9c3b7f2a46",
  "status": "approved",
  "created": "2026-07-27T09:22:41Z",
  "expires_at": "2026-07-27T10:22:41Z",
  "invocation_id": "019fa2e2-2f00-7a54-9f70-cd49ad3571d2",
  "adk_event_id": "019fa2e2-2f00-77e0-a459-008f7d11e9f8",
  "requested_by_user_id": "0190c234-1111-2222-3333-444444444444",
  "decided_by_user_id": "019df7a2-44a0-7f54-8478-e19c351d1cc8",
  "requester_is_decider": false,
  "tool_action_control_id": "019fa2e2-2f00-7d54-ab2e-0fd98d058991",
  "tool_args_preview": {
    "range": "Tickets!A:D",
    "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
    "value_input_option": "USER_ENTERED",
    "values": [
      [
        "NJ-1042",
        "TCK-4821",
        "resolved",
        "2026-07-27"
      ]
    ]
  },
  "agent_reason": "The resolved support ticket must be recorded for follow-up.",
  "decision": "approved",
  "decision_note": "Approved — logging the resolved ticket is fine.",
  "modified": "2026-07-27T09:24:15Z",
  "decided_at": "2026-07-27T09:24:15Z"
}
```

**SDK Code**

```python Approve with a decision note
import requests

url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve"

payload = { "decision_note": "Checked the recipient list; safe to send." }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Approve with a decision note
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"decision_note":"Checked the recipient list; safe to send."}'
};

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

```go Approve with a decision note
package main

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

func main() {

	url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve"

	payload := strings.NewReader("{\n  \"decision_note\": \"Checked the recipient list; safe to send.\"\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 with a decision note
require 'uri'
require 'net/http'

url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/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  \"decision_note\": \"Checked the recipient list; safe to send.\"\n}"

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

```java Approve with a decision note
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"decision_note\": \"Checked the recipient list; safe to send.\"\n}")
  .asString();
```

```php Approve with a decision note
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve', [
  'body' => '{
  "decision_note": "Checked the recipient list; safe to send."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Approve with a decision note
using RestSharp;

var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/approve");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"decision_note\": \"Checked the recipient list; safe to send.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve with a decision note
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["decision_note": "Checked the recipient list; safe to send."] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task-agent/task_agent_id/approval-request/approval_request_id/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()
```