> 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.

# List roles

GET https://api-dev.houseofapps.ai/v1/integrations/roles

List roles for the organization resolved from Isometrik credentials (`licenseKey`/`appSecret`).

Reference: https://docs.houseofapps.ai/api-reference/overview/platform/roles/external-get-roles-v-1-integrations-roles-get

## Request

### Query parameters

- `search` (string, optional, nullable) — Search term to filter roles by name (case-insensitive)
- `page` (integer, optional, default: 1) — The page number for pagination
- `page_size` (integer, optional, default: 20) — The number of items per page

### Headers

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

## Response

### 200

OK

- `message` (string, required) — Response message describing the operation result
- `roles` (list of RoleItem, required) — List of roles
- `total_count` (integer, required) — Total number of roles available (for pagination)

## 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

## Types

### RoleItem

Model for role information in lists Attributes: id (str): Unique identifier for the role name (str): Human-readable name of the role description (Optional[str]): Description of the role is_default (bool): Whether this is a system role (True) or custom role (False) created_at (str): ISO timestamp when role was created user_count (int): Number of users assigned to this role permission_count (int): Total number of permissions assigned to this role permission_categories (dict): Count of permissions by category

- `id` (string, required) — Unique identifier for the role
- `name` (string, required) — Human-readable name of the role
- `is_default` (boolean, required) — Whether this is a system role (True) or custom role (False)
- `created_at` (string, required) — ISO timestamp when role was created
- `user_count` (integer, required) — Number of users assigned to this role
- `permission_ids` (list of string, required) — List of permission IDs assigned to this role
- `permission_count` (integer, required) — Total number of permissions assigned to this role
- `permission_categories` (map from string to any, required) — Count of permissions by category
- `description` (string, optional, nullable) — Optional description for the role

## Examples

**Response**

```json
{
  "message": "Roles retrieved successfully with filters: limit=10",
  "roles": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Administrator",
      "is_default": true,
      "created_at": "2024-12-02T10:00:00Z",
      "user_count": 1,
      "permission_ids": [
        "string"
      ],
      "permission_count": 1,
      "permission_categories": {},
      "description": "This role can manage users and permissions."
    }
  ],
  "total_count": 1,
  "status_code": 200
}
```

**SDK Code**

```python
import requests

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

headers = {
    "appSecret": "appSecret",
    "licenseKey": "licenseKey"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-dev.houseofapps.ai/v1/integrations/roles';
const options = {method: 'GET', headers: {appSecret: 'appSecret', licenseKey: 'licenseKey'}};

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"
	"net/http"
	"io"
)

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("appSecret", "appSecret")
	req.Header.Add("licenseKey", "licenseKey")

	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")

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

request = Net::HTTP::Get.new(url)
request["appSecret"] = 'appSecret'
request["licenseKey"] = 'licenseKey'

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.get("https://api-dev.houseofapps.ai/v1/integrations/roles")
  .header("appSecret", "appSecret")
  .header("licenseKey", "licenseKey")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-dev.houseofapps.ai/v1/integrations/roles', [
  'headers' => [
    'appSecret' => 'appSecret',
    'licenseKey' => 'licenseKey',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-dev.houseofapps.ai/v1/integrations/roles");
var request = new RestRequest(Method.GET);
request.AddHeader("appSecret", "appSecret");
request.AddHeader("licenseKey", "licenseKey");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "appSecret": "appSecret",
  "licenseKey": "licenseKey"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-dev.houseofapps.ai/v1/integrations/roles")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```