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

# Update role

PUT https://api-dev.houseofapps.ai/v1/integrations/roles/{role_id}
Content-Type: application/json

Update an existing role's properties and permissions.

Reference: https://docs.houseofapps.ai/api-reference/overview/platform/roles/external-update-role-data-v-1-integrations-roles-role-id-put

## Request

### Path parameters

- `role_id` (string, required) — The UUID of the role to update

### Headers

- `licenseKey` (string, required)
- `appSecret` (string, required)

### Body (application/json)

This endpoint expects an UpdateRoleRequest.

- `name` (string, optional, nullable) — Updated name of the role
- `description` (string, optional, nullable) — Updated description of the role
- `is_default` (boolean, optional, nullable) — Whether this is a system role (True) or custom role (False)
- `permission_ids` (list of string, optional, nullable) — List of permission IDs to assign to this role

## Response

### 200

OK

- `message` (string, required) — Response message describing the operation result
- `status` (string, required) — Response status (success or error)

## Errors

### 400 Bad Request Error

Bad Request

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 401 Unauthorized Error

Unauthorized

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 403 Forbidden Error

Forbidden

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 404 Not Found Error

Not Found

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 409 Conflict Error

Conflict

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 422 Unprocessable Entity Error

Unprocessable Entity

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 429 Too Many Requests Error

Too Many Requests

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 500 Internal Server Error

Internal Server Error

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 503 Service Unavailable Error

Service Unavailable

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

## Examples

**Request**

```json
{
  "name": "Senior Project Manager",
  "description": "Manages multiple projects and senior team members",
  "is_default": false,
  "permission_ids": [
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "7ba7b810-9dad-11d1-80b4-00c04fd430c9"
  ]
}
```

**Response**

```json
{
  "message": "Role updated successfully",
  "status": "string",
  "status_code": 200
}
```

**SDK Code**

```python
import requests

url = "https://api-dev.houseofapps.ai/v1/integrations/roles/role_id"

payload = {
    "name": "Senior Project Manager",
    "description": "Manages multiple projects and senior team members",
    "is_default": False,
    "permission_ids": ["6ba7b810-9dad-11d1-80b4-00c04fd430c8", "7ba7b810-9dad-11d1-80b4-00c04fd430c9"]
}
headers = {
    "appSecret": "appSecret",
    "licenseKey": "licenseKey",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-dev.houseofapps.ai/v1/integrations/roles/role_id';
const options = {
  method: 'PUT',
  headers: {
    appSecret: 'appSecret',
    licenseKey: 'licenseKey',
    'Content-Type': 'application/json'
  },
  body: '{"name":"Senior Project Manager","description":"Manages multiple projects and senior team members","is_default":false,"permission_ids":["6ba7b810-9dad-11d1-80b4-00c04fd430c8","7ba7b810-9dad-11d1-80b4-00c04fd430c9"]}'
};

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-dev.houseofapps.ai/v1/integrations/roles/role_id"

	payload := strings.NewReader("{\n  \"name\": \"Senior Project Manager\",\n  \"description\": \"Manages multiple projects and senior team members\",\n  \"is_default\": false,\n  \"permission_ids\": [\n    \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n    \"7ba7b810-9dad-11d1-80b4-00c04fd430c9\"\n  ]\n}")

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

	req.Header.Add("appSecret", "appSecret")
	req.Header.Add("licenseKey", "licenseKey")
	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-dev.houseofapps.ai/v1/integrations/roles/role_id")

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

request = Net::HTTP::Put.new(url)
request["appSecret"] = 'appSecret'
request["licenseKey"] = 'licenseKey'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Senior Project Manager\",\n  \"description\": \"Manages multiple projects and senior team members\",\n  \"is_default\": false,\n  \"permission_ids\": [\n    \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n    \"7ba7b810-9dad-11d1-80b4-00c04fd430c9\"\n  ]\n}"

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.put("https://api-dev.houseofapps.ai/v1/integrations/roles/role_id")
  .header("appSecret", "appSecret")
  .header("licenseKey", "licenseKey")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Senior Project Manager\",\n  \"description\": \"Manages multiple projects and senior team members\",\n  \"is_default\": false,\n  \"permission_ids\": [\n    \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n    \"7ba7b810-9dad-11d1-80b4-00c04fd430c9\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api-dev.houseofapps.ai/v1/integrations/roles/role_id', [
  'body' => '{
  "name": "Senior Project Manager",
  "description": "Manages multiple projects and senior team members",
  "is_default": false,
  "permission_ids": [
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "7ba7b810-9dad-11d1-80b4-00c04fd430c9"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'appSecret' => 'appSecret',
    'licenseKey' => 'licenseKey',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-dev.houseofapps.ai/v1/integrations/roles/role_id");
var request = new RestRequest(Method.PUT);
request.AddHeader("appSecret", "appSecret");
request.AddHeader("licenseKey", "licenseKey");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Senior Project Manager\",\n  \"description\": \"Manages multiple projects and senior team members\",\n  \"is_default\": false,\n  \"permission_ids\": [\n    \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\",\n    \"7ba7b810-9dad-11d1-80b4-00c04fd430c9\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "appSecret": "appSecret",
  "licenseKey": "licenseKey",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Senior Project Manager",
  "description": "Manages multiple projects and senior team members",
  "is_default": false,
  "permission_ids": ["6ba7b810-9dad-11d1-80b4-00c04fd430c8", "7ba7b810-9dad-11d1-80b4-00c04fd430c9"]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-dev.houseofapps.ai/v1/integrations/roles/role_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```