Get role
curl --request GET \
--url http://localhost:8080/roles/{role_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/roles/{role_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/roles/{role_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/roles/{role_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/roles/{role_id}"
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(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/roles/{role_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/roles/{role_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"permissions": [
"*"
],
"is_inherited": true
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Roles
Get an organization role
Read a single organization role and its inherited status by ID. Use this endpoint to inspect permissions without relying on a unique display name.
GET
/
roles
/
{role_id}
Get role
curl --request GET \
--url http://localhost:8080/roles/{role_id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/roles/{role_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/roles/{role_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/roles/{role_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/roles/{role_id}"
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(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/roles/{role_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/roles/{role_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"permissions": [
"*"
],
"is_inherited": true
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Requires
roles:read. A role outside the current organization returns 404.
is_inherited: true identifies a copy managed through the main billing organization. Its name may match a local role with different permissions. Use role_id to identify the intended role.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Role ID
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
Default Response
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Available options:
*, sessions:read, sessions:write, team-sessions:read, team-sessions:write, assigned-sessions:read, assigned-sessions:write, hybrid-inbox:read, phone-outbound-all-numbers:write, sessions-personal-views:write, sessions-shared-views:read, sessions-shared-views:write, sessions-create:write, sessions-sub-sessions:write, merge-sessions:write, sessions-delete-own-messages:write, contacts:read, contacts:write, companies:read, companies:write, sequences:read, sequences:write, ai-training:read, ai-training:write, reports:read, reports:write, help-center:read, help-center:write, help-center-content:read, help-center-content:write, workflows:read, workflows:write, workflows:execute, actions:read, actions:write, mini-apps:read, mini-apps:write, companion:read, companion:write, redaction:read, redaction:write, voc:read, voc:write, audit-logs:read, settings:read, settings:write, settings-general:read, settings-general:write, settings-billing:read, settings-billing:write, settings-api-keys:read, settings-api-keys:write, settings-autopilot:read, settings-autopilot:write, settings-structured-fields:read, settings-structured-fields:write, settings-webhooks:read, settings-webhooks:write, settings-secrets:read, settings-secrets:write, settings-handoff:read, settings-handoff:write, settings-translations:read, settings-translations:write, settings-sso:read, settings-sso:write, settings-security:read, settings-security:write, settings-integrations:read, settings-integrations:write, settings-members:read, settings-members:write, settings-agent-availability:read, settings-agent-availability:write, settings-tags:read, settings-tags:write, settings-sla:read, settings-sla:write, settings-csat:read, settings-csat:write, settings-reports:read, settings-reports:write, settings-office-hours:read, settings-office-hours:write, settings-channels:read, settings-channels:write, settings-channels-voice:read, settings-channels-voice:write, settings-email-fleet:read, settings-email-fleet:write, settings-helpdesk:read, settings-helpdesk:write, settings-custom-statuses:read, settings-custom-statuses:write, settings-availability-statuses:read, settings-availability-statuses:write, settings-personal-profile:read, settings-personal-profile:write, settings-groups:read, settings-groups:write, settings-roles:read, settings-roles:write, settings-scim-role-mappings:read, settings-scim-role-mappings:write, settings-macros:read, settings-macros:write, settings-skills:read, settings-skills:write Inherited roles are read-only in this organization. A local and inherited role may share a name; use their IDs to distinguish them.
Was this page helpful?