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

# Update a role

PATCH https://api.sandbox.monite.com/v1/roles/{role_id}
Content-Type: application/json

Change the specified fields with the provided values.

Reference: https://docs.monite.com/api/roles/patch-roles-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.sandbox.monite.com/v1` (sandbox, default)
- `https://api.monite.com/v1` (eu_production)
- `https://us.api.monite.com/v1` (na_production)

## Request

### Path parameters

- `role_id` (string, required)

### Headers

- `x-monite-version` (string, required)
- `x-monite-entity-id` (string, required) — The ID of the entity that owns the requested resource.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — Role name
- `permissions` (BizObjectsSchemaInput, optional) — Access permissions

## Response

### 200

Successful Response

- `id` (string, required) — UUID role ID
- `created_at` (datetime, required) — UTC datetime
- `updated_at` (datetime, required) — UTC datetime
- `name` (string, required) — Role name
- `permissions` (BizObjectsSchemaOutput, required) — Access permissions
- `status` (enum, required) — record status, 'active' by default
  - Allowed values: `active`, `deleted`

## Errors

### 400 Patch Roles ID Request Bad Request Error

Bad Request

- `error` (ErrorSchema, required)

### 422 Patch Roles ID Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Patch Roles ID Request Internal Server Error

Internal Server Error

- `error` (ErrorSchema, required)

## Types

### BizObjectsSchemaInput

- `objects` (list of RootSchemaInput, optional) — List of objects

### BizObjectsSchemaOutput

- `objects` (list of RootSchemaOutput, optional) — List of objects

### ErrorSchema

- `message` (string, required)

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### RootSchemaInput

- `object_type`: `accounting_tax_rate`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `approval_policy`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `approval_request`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `comment`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `cost_center`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `counterpart`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `counterpart_vat_id`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `delivery_note`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity_bank_account`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity_user`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity_vat_ids`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `export`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `ledger_account`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `mailbox`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `ocr_task`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `onboarding`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `overdue_reminder`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `payable`
  - `actions` (list of PayableActionSchema, optional) — List of actions
- `object_type`: `payables_purchase_order`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `payment_record`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `payment_reminder`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `person`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `product`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `project`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `receipt`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `receivable`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `reconciliation`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `role`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `tag`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `todo_task`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `todo_task_mute`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `transaction`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `workflow`
  - `actions` (list of ActionSchema, optional) — List of actions

### RootSchemaOutput

- `object_type`: `accounting_tax_rate`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `approval_policy`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `approval_request`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `comment`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `cost_center`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `counterpart`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `counterpart_vat_id`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `delivery_note`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity_bank_account`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity_user`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `entity_vat_ids`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `export`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `ledger_account`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `mailbox`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `ocr_task`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `onboarding`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `overdue_reminder`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `payable`
  - `actions` (list of PayableActionSchema, optional) — List of actions
- `object_type`: `payables_purchase_order`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `payment_record`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `payment_reminder`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `person`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `product`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `project`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `receipt`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `receivable`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `reconciliation`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `role`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `tag`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `todo_task`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `todo_task_mute`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `transaction`
  - `actions` (list of ActionSchema, optional) — List of actions
- `object_type`: `workflow`
  - `actions` (list of ActionSchema, optional) — List of actions

### ValidationErrorLocItem

### ActionSchema

- `action_name` (enum, optional) — Action name
  - Allowed values: `create`, `read`, `update`, `delete`
- `permission` (enum, optional) — Permission type
  - Allowed values: `allowed`, `allowed_for_own`, `not_allowed`

### PayableActionSchema

- `action_name` (enum, optional) — Action name
  - Allowed values: `create`, `read`, `update`, `delete`, `pay`, `approve`, `cancel`, `submit`, `create_from_mail`, `reopen`
- `permission` (enum, optional) — Permission type
  - Allowed values: `allowed`, `allowed_for_own`, `not_allowed`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "id",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "name": "name",
  "permissions": {
    "objects": [
      {
        "object_type": "accounting_tax_rate",
        "actions": [
          {
            "action_name": "create",
            "permission": "allowed"
          }
        ]
      }
    ]
  },
  "status": "active"
}
```

**SDK Code**

```python
import requests

url = "https://api.sandbox.monite.com/v1/roles/role_id"

payload = {}
headers = {
    "x-monite-version": "2024-01-31",
    "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.sandbox.monite.com/v1/roles/role_id';
const options = {
  method: 'PATCH',
  headers: {
    'x-monite-version': '2024-01-31',
    'x-monite-entity-id': '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    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
package main

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

func main() {

	url := "https://api.sandbox.monite.com/v1/roles/role_id"

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

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

	req.Header.Add("x-monite-version", "2024-01-31")
	req.Header.Add("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
	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
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.monite.com/v1/roles/role_id")

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

request = Net::HTTP::Patch.new(url)
request["x-monite-version"] = '2024-01-31'
request["x-monite-entity-id"] = '9d2b4c8f-2087-4738-ba91-7359683c49a4'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

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

HttpResponse<String> response = Unirest.patch("https://api.sandbox.monite.com/v1/roles/role_id")
  .header("x-monite-version", "2024-01-31")
  .header("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.sandbox.monite.com/v1/roles/role_id', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'x-monite-entity-id' => '9d2b4c8f-2087-4738-ba91-7359683c49a4',
    'x-monite-version' => '2024-01-31',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.sandbox.monite.com/v1/roles/role_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-monite-version", "2024-01-31");
request.AddHeader("x-monite-entity-id", "9d2b4c8f-2087-4738-ba91-7359683c49a4");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-monite-version": "2024-01-31",
  "x-monite-entity-id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
  "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://api.sandbox.monite.com/v1/roles/role_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()
```