Get groups by type¶
GET/
Endpoint API · Endpoint Groups Management
Endpoint groups of your specified type in the directory.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
groupType | path | string | Yes | Endpoint group type. Must be one of: computer, server. |
sort | query | array of string | No | Sort criteria for endpoint groups. Valid sort fields are id, name, createdAt, and updatedAt. You can append ':asc' or ':desc' to each field to specify the sort direction. The default sort direction for each field is unspecified.Each item must match the pattern (^[^:]+$)|(^[^:]+:(asc|desc)$). |
fields | query | array of string | No | The fields to return in a partial response. |
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 | The size of the page requested. Must be ≥ 1 and ≤ 500. |
ids | query | array of string (uuid) | No | IDs to match. Must contain at most 50 items. Items must be unique. |
search | query | string | No | Search term. Must match the pattern ^[^#,+"\\<>;]+$. |
searchFields | query | array of string | No | Search your specified fields. The default is to search group names only. Each item must be one of: name, description. |
endpointIds | query | array of string (uuid) | No | Endpoint UUIDs. Must contain at most 50 items. Items must be unique. |
Request samples¶
curl -X GET "https://api-<data-region>.central.sophos.com/endpoint/v1/endpoint-groups/types/computer" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"
import requests
response = requests.get(
"https://api-<data-region>.central.sophos.com/endpoint/v1/endpoint-groups/types/computer",
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/endpoint/v1/endpoint-groups/types/computer" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api-<data-region>.central.sophos.com/endpoint/v1/endpoint-groups/types/computer", 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/endpoint/v1/endpoint-groups/types/computer", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — A page of endpoint groups.¶
Response fields
itemsarray of objectrequiredEndpoint group in the directory.
Show child attributesHide child attributes
idstring (uuid)requiredGroup ID.
namestringrequiredGroup name.
Must match the pattern
Must match the pattern
^[^#,+"\\<>;]+$.descriptionstringGroup description.
Must match the pattern
Must match the pattern
^[^#,+"\\<>;]+$.typestring (enum)requiredEndpoint group types.
Must be one of:
Must be one of:
computer, server.endpointsobjectAssociated endpoints.
Show child attributesHide child attributes
totalintegerTotal number of endpoints in this group.
itemsCountintegerTotal number of items in the list.
itemsarray of objectItems must be unique.
Reference to an endpoint.
Show child attributesHide child attributes
idstring (uuid)requiredUnique endpoint ID.
hostnamestringEndpoint hostname.
tenantobjectrequiredReference to a tenant.
Show child attributesHide child attributes
idstring (uuid)requiredTenant ID.
createdAtstring (date-time)When the group was created.
updatedAtstring (date-time)When the group was last updated.
pagesobjectrequiredShow child attributesHide child attributes
currentintegerrequiredThe 1-based page number being returned.
sizeintegerrequiredThe 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.
maxSizeintegerrequiredThe 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": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string",
"type": "computer",
"endpoints": {
"total": 0,
"itemsCount": 0,
"items": [
{
"id": "00000000-0000-0000-0000-000000000000",
"hostname": "string"
}
]
},
"tenant": {
"id": "00000000-0000-0000-0000-000000000000"
},
"createdAt": "2026-07-28T00:00:00Z",
"updatedAt": "2026-07-28T00:00:00Z"
}
],
"pages": {
"current": 0,
"size": 0,
"total": 0,
"items": 0,
"maxSize": 0
}
}
See the guide for a narrative walkthrough of this API.