Get endpoints¶
GET/
Live Discover API · Query Run
Get statuses of endpoints in the query run.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
runId | path | string (uuid) | Yes | Query run ID. |
pageSize | query | integer | No | The size of the page requested. |
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. |
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. |
match | query | array of string | No | Combination of query run status, result, and "with data" filter, delimited with a : (colon) symbol. For example, finished:succeeded:withData, finished:succeeded:withoutData. |
Request samples¶
curl -X GET "https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/endpoints" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"
import requests
response = requests.get(
"https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/endpoints",
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/live-discover/v1/queries/runs/<runId>/endpoints" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api-<data-region>.central.sophos.com/live-discover/v1/queries/runs/<runId>/endpoints", 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/live-discover/v1/queries/runs/<runId>/endpoints", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Endpoint statuses.¶
Response fields
itemsarray of objectrequiredList of endpoint status objects.
Status of an endpoint in a query run.
Show child attributesHide child attributes
idstring (uuid)requiredEndpoint ID.
typestringrequiredEndpoint type. Please note
Must be one of:
securityVm is deprecated and will be removed soon.Must be one of:
computer, server, securityVm.hostnamestringrequiredEndpoint hostname.
osobjectOS information.
Show child attributesHide child attributes
isServerbooleanWhether the OS is a server OS.
platformstringrequiredOS platform type.
Must be one of:
Must be one of:
windows, linux, macOS.namestringrequiredOS name as reported by the endpoint.
majorVersionintegerOS major version.
minorVersionintegerOS minor version.
buildintegerOS build.
ipv4Addressesarray of stringList of IPv4 addresses.
ipv6Addressesarray of stringList of IPv6 addresses.
statusstringrequiredStatus of a query run.
Must be one of:
Must be one of:
pending, started, finished.resultstringOverall result of a query run.
Must be one of:
Must be one of:
notAvailable, succeeded, failed, timedOut.statusCodestringStatus code returned by the query running on the endpoint.
statusMessagestringMessage returned by the query running on the endpoint.
performanceobjectQuery run metrics for an endpoint.
Show child attributesHide child attributes
scorestringLive Discover query performance score.
Must be one of:
Must be one of:
excellent, good, fair, poor, notEvaluated.dataTransferredInBytesintegerTotal size of the query results returned by the endpoints.
executionTimeInMillisintegerTime the query took to execute on the endpoint.
resultCountintegerNumber of rows of results returned by the endpoint.
createdAtstring (datetime)When the endpoint sent the first status.
finishedAtstring (datetime)When the endpoint finished running the query.
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 |
|---|---|
403 | Forbidden. |
404 | Can't find query run. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"items": [
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "computer",
"hostname": "string",
"os": {
"isServer": true,
"platform": "windows",
"name": "string",
"majorVersion": 0,
"minorVersion": 0,
"build": 0
},
"ipv4Addresses": [
"string"
],
"ipv6Addresses": [
"string"
],
"status": "pending",
"result": "notAvailable",
"statusCode": "string",
"statusMessage": "string",
"performance": {
"score": "excellent",
"dataTransferredInBytes": 0,
"executionTimeInMillis": 0
},
"resultCount": 0,
"createdAt": "string",
"finishedAt": "string"
}
],
"pages": {
"current": 0,
"size": 0,
"total": 0,
"items": 0,
"maxSize": 0
}
}
See the guide for a narrative walkthrough of this API.