Skip to content

List all admins

GET/admins

Common API · tenant-access

List all tenant admins.

Required permissiontenant-admin:list AND assignment:read

Parameters

Name In Type Required Description
X-Tenant-ID header string (uuid) Yes Tenant ID.
sort query array of string No Defines how to sort the data.
Each item must match the pattern (^[^:]+$)|(^[^:]+:(asc|desc)$).
fields query array of string No The fields to return in a partial response.
search query string No Search for items that match the given terms.
searchFields query array of string (enum) No Search only within the specified fields, username field is default if search query is specified.
Each item must be one of: username.
roleId query string (uuid) No Role ID to search.
page query integer No The page number to fetch, starting with 1.
pageTotal query boolean No Whether the number of pages should be calculated and returned in the response.
pageSize query integer No Size of the page requested.
Must be ≥ 1 and ≤ 100.

Request samples

curl -X GET "https://api-<data-region>.central.sophos.com/common/v1/admins" -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",
    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" -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", 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", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Paged array of tenant admins.

Response fields

itemsarray of objectrequired
Page of tenant admins.
Tenant admin.
Show child attributesHide child attributes
idstring (uuid)required
Admin UUID.
tenantobjectrequired
Reference to a tenant.
Show child attributesHide child attributes
idstring (uuid)required
Tenant ID.
namestring
Tenant Name.
usersarray of objectrequired
List of directory users with which admin is associated by email.
Items must be unique.
Reference to the user.
Show child attributesHide child attributes
idstring (uuid)required
User ID.
namestring
User's full name.
profileobjectrequired
Admin profile with personal details.
Show child attributesHide child attributes
namestringrequired
Name of user.
firstNamestring
First name of user.
lastNamestring
Last name of user.
emailstring (email)required
Email ID of user.
roleAssignmentsarray of objectrequired
List of role assignments.
Items must be unique.
Role assignment.
Show child attributesHide child attributes
idstring (uuid)required
Role assignment ID.
roleIdstring (uuid)required
Role UUID.
createdAtstring (datetime)
Date and time the tenant admin was created.
updatedAtstring (datetime)
Date and time the tenant admin was last updated.
pagesobjectrequired
Show child attributesHide child attributes
currentintegerrequired
The 1-based page number being returned.
sizeintegerrequired
The size of the page being returned.
totalinteger
(Optional) The total number of pages that exist, if pageTotal=true in the request.
itemsinteger
(Optional) The total number of items across all pages.
maxSizeintegerrequired
The maximum page size that can be requested.

Errors

Status Meaning
500 Internal server error.

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

Response examples

200

{
  "items": [
    {
      "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"
    },
    {
      "id": "e7f8d6de-5030-4e5b-a07a-b01865642afb",
      "tenant": {
        "id": "79067fa3-e4d0-4769-a5f7-8d6550b3b68b"
      },
      "users": [
        {
          "id": "17ee9fd4-ec71-4b07-8c8a-bfbf9391e1dc",
          "name": "Fred Bloggs"
        }
      ],
      "profile": {
        "name": "Freddie Bloggs",
        "firstName": "Fred",
        "lastName": "Bloggs",
        "email": "flogs@example.com"
      },
      "roleAssignments": [
        {
          "id": "95105bd1-b96f-4f77-b220-57f00a43b1ef",
          "roleId": "fd160a43-87e4-4334-8732-4de1bc9202d8"
        }
      ],
      "createdAt": "2021-01-03T10:45:01.492Z",
      "updatedAt": "2021-02-12T18:28:42.004Z"
    }
  ]
}