> This page is for Workforce.

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

# Review tool access request

PATCH https://ah-api.merge.dev/api/v1/tool-access-requests/{request_id}/
Content-Type: application/json

Approve or deny a pending request, or revoke an approved one, by setting its status.

Reference: https://docs.merge.dev/merge-workforce/agent-handler/tool-access-requests/tool-access-requests-partial-update

## Authentication

- `Authorization` header (bearer token, required) — Token-based authentication with required prefix "Bearer"

## Request

### Path parameters

- `request_id` (string, required)

### Body (application/json)

This endpoint expects a PatchedToolAccessRequestReview.

- `status` (enum, required) — `approved` or `denied` decides a pending request; `revoked` removes the access an approved request granted. Expiry fields are only accepted with `approved`.
  - Allowed values: `approved`, `denied`, `revoked`
- `expires_at` (datetime, optional, nullable) — When the granted access ends.
- `expires_in_seconds` (integer, optional) — Seconds from now until the granted access ends.
- `permanent` (boolean, optional) — Grant access with no expiry. With no expiry field set, the expiry the requester asked for is used.
- `decision_note` (string, optional, default: )

## Response

### 200

- `id` (string, required)
- `registered_user` (ToolAccessRequestRegisteredUser, required) — The employee who filed the request.
- `tool_pack` (ToolAccessRequestToolPack, required, nullable) — The tool pack the request was filed from.
- `reason` (string, required)
- `reviewed_by` (ToolAccessRequestReviewer, required, nullable) — The dashboard user who decided the request.
- `created_at` (datetime, required)
- `modified_at` (datetime, required)
- `status` (enum, optional)
  - Allowed values: `pending`, `approved`, `denied`, `revoked`, `canceled`
- `requested_tool_slugs` (list of string, optional)
- `requested_expires_at` (datetime, optional, nullable) — Requested expiration. Null means permanent access was requested.
- `approved_tool_slugs` (list of string, optional)
- `approved_expires_at` (datetime, optional, nullable) — Approved expiration. Null means permanent access.
- `decision_note` (string, optional)
- `approved_at` (datetime, optional, nullable)
- `denied_at` (datetime, optional, nullable)
- `revoked_at` (datetime, optional, nullable)
- `canceled_at` (datetime, optional, nullable)

## Types

### ToolAccessRequestRegisteredUser

The employee who filed the request.

- `id` (string, required)
- `origin_id` (string, required)
- `name` (string, required)

### ToolAccessRequestToolPack

The tool pack the request was filed from.

- `id` (string, required)
- `name` (string, required)

### ToolAccessRequestReviewer

The dashboard user who decided the request.

- `id` (string, required)
- `email` (string, required)
- `name` (string, required)

## Examples

**Request**

```json
{
  "status": "approved",
  "expires_in_seconds": 604800,
  "decision_note": "Approved for the incident."
}
```

**Response**

```json
{
  "id": "0c5e8f7a-3b2d-4f61-8e9a-7d4c1b2a3f50",
  "registered_user": {
    "id": "9a7b6c5d-4e3f-4a2b-8c1d-0e9f8a7b6c5d",
    "origin_id": "00u1abcd2EFGH3ijk4l5",
    "name": "Jane Doe"
  },
  "tool_pack": {
    "id": "1d8b6f4a-1b3e-4f9b-9d3a-3a8e8b9c0d1f",
    "name": "Engineering"
  },
  "reason": "Triage bug ticket 123",
  "reviewed_by": null,
  "created_at": "2026-10-30T19:58:12Z",
  "modified_at": "2026-10-30T20:02:00Z",
  "status": "approved",
  "requested_tool_slugs": [
    "jira__create_issue"
  ],
  "requested_expires_at": "2026-11-06T00:00:00Z",
  "approved_tool_slugs": [
    "jira__create_issue"
  ],
  "approved_expires_at": "2026-11-06T00:00:00Z",
  "decision_note": "Approved for the incident.",
  "approved_at": "2026-10-30T20:02:00Z",
  "denied_at": null,
  "revoked_at": null,
  "canceled_at": null
}
```

**SDK Code**

```python Approve for one week (application/json)
import requests

url = "https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/"

payload = {
    "status": "approved",
    "expires_in_seconds": 604800,
    "decision_note": "Approved for the incident."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Approve for one week (application/json)
const url = 'https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"status":"approved","expires_in_seconds":604800,"decision_note":"Approved for the incident."}'
};

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

```go Approve for one week (application/json)
package main

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

func main() {

	url := "https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/"

	payload := strings.NewReader("{\n  \"status\": \"approved\",\n  \"expires_in_seconds\": 604800,\n  \"decision_note\": \"Approved for the incident.\"\n}")

	req, _ := http.NewRequest("PATCH", 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 for one week (application/json)
require 'uri'
require 'net/http'

url = URI("https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"approved\",\n  \"expires_in_seconds\": 604800,\n  \"decision_note\": \"Approved for the incident.\"\n}"

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

```java Approve for one week (application/json)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"approved\",\n  \"expires_in_seconds\": 604800,\n  \"decision_note\": \"Approved for the incident.\"\n}")
  .asString();
```

```php Approve for one week (application/json)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/', [
  'body' => '{
  "status": "approved",
  "expires_in_seconds": 604800,
  "decision_note": "Approved for the incident."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Approve for one week (application/json)
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"approved\",\n  \"expires_in_seconds\": 604800,\n  \"decision_note\": \"Approved for the incident.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve for one week (application/json)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "status": "approved",
  "expires_in_seconds": 604800,
  "decision_note": "Approved for the incident."
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/tool-access-requests/:request_id/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```