# Update Role

Partial update of a custom role. Note that `role_type` is immutable — an `account`-scoped role cannot be converted to `organization` scope or vice versa. Create a new role with the desired `role_type` instead. See [Create Role](/reference/organizations/create-role).

**PATCH** `/organizations/roles/{role_id}`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Partial update of a custom role. Note: role_type is immutable.

## Authorization

- PUBLIC-API-KEY (apiKey in header)
- PRIVATE-SECRET-KEY (apiKey in header)

## Path parameters

- `role_id` (string, required)
  The unique identifier of the role.

## Body

Content type: `application/json`

- `name` (string)
- `description` (string)
- `permission_ids` (string[])
- `testing_permission_ids` (string[])

Example:

```json
{
  "name": "string",
  "description": "string",
  "permission_ids": [
    "string"
  ],
  "testing_permission_ids": [
    "string"
  ]
}
```

## Responses

### 200

OK

- `id` (string)
- `name` (string)
- `description` (string)
- `admin` (boolean)
- `permission_ids` (string[])
- `testing_permission_ids` (string[])
- `role_type` (string)
- `created_at` (string<date-time>)
- `updated_at` (string<date-time>)

Example:

```json
{
  "id": "string",
  "name": "string",
  "description": "string",
  "admin": true,
  "permission_ids": [
    "string"
  ],
  "testing_permission_ids": [
    "string"
  ],
  "role_type": "string",
  "created_at": "1970-01-01T00:00:00.000Z",
  "updated_at": "1970-01-01T00:00:00.000Z"
}
```

### 400

Bad Request - Validation failure

### 404

Not Found - Role not found in organization