Skip to content

Get role by ID

GET/admins/{adminId}/role-assignments/{assignmentId}

Common API · tenant-access

Get tenant admin role assignment by ID.

Required permissionassignment:read

Parameters

Name In Type Required Description
X-Tenant-ID header string (uuid) Yes Tenant ID.
adminId path string (uuid) Yes Admin ID.
assignmentId path string (uuid) Yes Role Assignment ID.

Request samples

curl -X GET "https://api-<data-region>.central.sophos.com/common/v1/admins/<adminId>/role-assignments/<assignmentId>" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"

import requests

response = requests.get(
    "https://api-<data-region>.central.sophos.com/common/v1/admins/<adminId>/role-assignments/<assignmentId>",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Tenant-ID": "<tenant-id>",
    },
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Tenant-ID" = "<tenant-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api-<data-region>.central.sophos.com/common/v1/admins/<adminId>/role-assignments/<assignmentId>" -Headers $headers

package main

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

func main() {
    req, err := http.NewRequest("GET", "https://api-<data-region>.central.sophos.com/common/v1/admins/<adminId>/role-assignments/<assignmentId>", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Tenant-ID", "<tenant-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-<data-region>.central.sophos.com/common/v1/admins/<adminId>/role-assignments/<assignmentId>", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Details of role assignment.

Response fields

idstring (uuid)required
Role assignment ID.
roleIdstring (uuid)required
Role UUID.

Errors

Status Meaning
404 Can't find admin or assignment.
500 Internal server error.

All error responses share the same shape — see the error response object.

Response examples

200

{
  "id": "4bcb8ee6-720b-40c7-b748-716a3c47c185",
  "roleId": "c83c9481-f63c-4eb8-8793-e81eb9d66ef4"
}