> This page is for Developers.

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

# List system and custom roles

GET https://cdn.emnify.net/api/v1/organisation/{orgId}/role

Required permissions Beta [Learn more](/developers/api-guidelines/permissions#how-permissions-work)`Organisation.Role` + `List`Roles: Administrator UserReturns all roles in the Workspace.
System roles come first, in the order Administrator, User, and Observer, followed by custom roles alphabetically.Pass `include_permissions=true` to also receive each role's permission list.
Use `my` in place of a numeric `orgId` to target the caller's own Workspace.

Reference: https://docs.emnify.com/developers/api/permission-and-role-management/list-organisation-roles

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Path parameters

- `orgId` (ApiV1OrganisationOrgIdRoleGetParametersOrgId, required) — Workspace identifier. Either a positive integer organization ID, or the literal string `my` to target the caller's own Workspace.

### Query parameters

- `include_permissions` (boolean, optional, default: false) — When true, each returned role also includes its `permissions` array. Defaults to `false` to keep the list response light.

## Response

### 200

Successful response.

- `list of RoleOutputDto`

## Errors

### 404 Not Found Error

Organization not found.

- `status_code` (integer, optional)
- `message` (string, optional)

## Types

### ApiV1OrganisationOrgIdRoleGetParametersOrgId

### RoleOutputDto

- `id` (double, required) — Unique role identifier.
- `name` (string, required) — Display name of the role.
- `name_translation_key` (string, required, nullable) — Translation key for the role name. Set for system roles only.
- `description` (string, required) — Human-readable description of the role. An empty string when no description has been set.
- `description_translation_key` (string, required, nullable) — Translation key for the role description. Set for system roles only.
- `user_count` (double, required) — Number of users assigned to this role in the Workspace.
- `type` (enum, required) — Whether this is a system-defined role or an organization's custom role.
  - Allowed values: `system`, `custom`
- `is_system_role` (boolean, required) — True for built-in system roles, which can't be modified or deleted.
- `permissions` (list of RolePermissionOutputDto, optional) — Permissions assigned to this role. Present only on single-role retrieval, or on the list when `include_permissions=true`.

### RolePermissionOutputDto

- `id` (double, required) — Unique permission identifier.
- `resource` (string, required) — Resource the permission applies to.
- `action` (string, required) — Action the permission grants on the resource.

## Examples

**Response**

```json
[
  {
    "id": 1,
    "name": "Administrator",
    "name_translation_key": "user_role_administrator_name",
    "description": "Full access to all organization features and settings.",
    "description_translation_key": "user_role_administrator_description",
    "user_count": 4,
    "type": "system",
    "is_system_role": true
  },
  {
    "id": 2,
    "name": "User",
    "name_translation_key": "user_role_user_name",
    "description": "Partial write access.",
    "description_translation_key": "user_role_user_description",
    "user_count": 12,
    "type": "system",
    "is_system_role": true
  },
  {
    "id": 3,
    "name": "Observer",
    "name_translation_key": "user_role_observer_name",
    "description": "Read-only access.",
    "description_translation_key": "user_role_observer_description",
    "user_count": 3,
    "type": "system",
    "is_system_role": true
  },
  {
    "id": 101,
    "name": "Fleet operator",
    "name_translation_key": null,
    "description": "Can manage endpoints and SIMs but not billing.",
    "description_translation_key": null,
    "user_count": 2,
    "type": "custom",
    "is_system_role": false
  }
]
```

**SDK Code**

```python Role List
import requests

url = "https://cdn.emnify.net/api/v1/organisation/my/role"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Role List
const url = 'https://cdn.emnify.net/api/v1/organisation/my/role';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Role List
package main

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

func main() {

	url := "https://cdn.emnify.net/api/v1/organisation/my/role"

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

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Role List
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/organisation/my/role")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://cdn.emnify.net/api/v1/organisation/my/role")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://cdn.emnify.net/api/v1/organisation/my/role', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Role List
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/organisation/my/role");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Role List
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/organisation/my/role")! 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()
```