Get role by ID¶
GET/
Organization API · Organization Admins
Get organization administrator role assignment by ID.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Organization-ID | header | string (uuid) | Yes | Organization ID. |
adminId | path | string | Yes | Admin ID. |
assignmentId | path | string (uuid) | Yes | Role assignment ID. |
Request samples¶
curl -X GET "https://api.central.sophos.com/organization/v1/admins/<adminId>/role-assignments/<assignmentId>" -H "Authorization: Bearer <access-token>" -H "X-Organization-ID: <organization-id>"
import requests
response = requests.get(
"https://api.central.sophos.com/organization/v1/admins/<adminId>/role-assignments/<assignmentId>",
headers={
"Authorization": "Bearer <access-token>",
"X-Organization-ID": "<organization-id>",
},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Organization-ID" = "<organization-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api.central.sophos.com/organization/v1/admins/<adminId>/role-assignments/<assignmentId>" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.central.sophos.com/organization/v1/admins/<adminId>/role-assignments/<assignmentId>", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Organization-ID", "<organization-id>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api.central.sophos.com/organization/v1/admins/<adminId>/role-assignments/<assignmentId>", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Organization-ID": "<organization-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Details of role assignment.¶
Response fields
idstring (uuid)requiredRole assignment ID.
roleIdstring (uuid)requiredRole ID.
roleNamestringRole name.
scopeobjectrequiredRole assignment scope.
Show child attributesHide child attributes
typestringrequiredRole assignment scope type.
Must be one of:
Must be one of:
tenant, allManagedTenants, self, tenantGroup.idstring (uuid)Tenant ID. Optional or not present when
type is allManagedTenants or self.namestringTenant name. Optional or not present when
type is allManagedTenants or self.Errors¶
| Status | Meaning |
|---|---|
404 | Can't find admin or assignment. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
See the guide for a narrative walkthrough of this API.