Get admin by ID¶
GET/
Common API · tenant-access
Get tenant admin details by ID.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
fields | query | array of string | No | The fields to return in a partial response. |
adminId | path | string (uuid) | Yes | Admin ID. |
Request samples¶
curl -X GET "https://api-<data-region>.central.sophos.com/common/v1/admins/<adminId>" -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>",
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>" -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>", 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>", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Details of the requested tenant admin.¶
Response fields
idstring (uuid)requiredAdmin UUID.
tenantobjectrequiredReference to a tenant.
Show child attributesHide child attributes
idstring (uuid)requiredTenant ID.
namestringTenant Name.
usersarray of objectrequiredList of directory users with which admin is associated by email.
Items must be unique.
Items must be unique.
Reference to the user.
Show child attributesHide child attributes
idstring (uuid)requiredUser ID.
namestringUser's full name.
profileobjectrequiredAdmin profile with personal details.
Show child attributesHide child attributes
namestringrequiredName of user.
firstNamestringFirst name of user.
lastNamestringLast name of user.
emailstring (email)requiredEmail ID of user.
roleAssignmentsarray of objectrequiredList of role assignments.
Items must be unique.
Items must be unique.
Role assignment.
Show child attributesHide child attributes
idstring (uuid)requiredRole assignment ID.
roleIdstring (uuid)requiredRole UUID.
createdAtstring (datetime)Date and time the tenant admin was created.
updatedAtstring (datetime)Date and time the tenant admin was last updated.
Errors¶
| Status | Meaning |
|---|---|
404 | Can't find admin. |
500 | Internal server error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"id": "e1c7aa85-7863-4561-a50e-2b345b0e16e5",
"tenant": {
"id": "79067fa3-e4d0-4769-a5f7-8d6550b3b68b"
},
"users": [
{
"id": "17dd896f-ee9f-4f7d-a2a2-6a8c0b48ff15",
"name": "John Smith"
},
{
"id": "95685fcb-8ee1-4fad-96e6-966dd5588025",
"name": "Johnny Smith"
}
],
"profile": {
"name": "John Smith",
"firstName": "John",
"lastName": "Smith",
"email": "john.smith@example.com"
},
"roleAssignments": [
{
"id": "4bcb8ee6-720b-40c7-b748-716a3c47c185",
"roleId": "c83c9481-f63c-4eb8-8793-e81eb9d66ef4"
}
],
"createdAt": "2021-01-02T15:32:59.789Z",
"updatedAt": "2021-02-12T20:00:01.329Z"
}