Query alerts¶
GET/
Common API · Alerts
Get alerts matching criteria in query parameters.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
groupKey | query | string | No | Alert group key. You can filter by group key. |
from | query | string (datetime) | No | You can find alerts that were raised on or after this time. |
to | query | string (datetime) | No | You can find alerts that were raised before this time. |
sort | query | array of string | No | Defines how to sort the data. Each item must match the pattern (^[^:]+$)|(^[^:]+:([aA]|[dD][eE])[sS][cC]$). |
product | query | array of string | No | Alerts for a product. You can query by product types. Each item must be one of: other, endpoint, server, mobile, encryption, emailGateway, webGateway, phishThreat, wireless, firewall, ztna, cswitch, secureWebservice. |
category | query | array of string | No | Alert category. You can query by different categories. Each item must be one of: adSync, applicationControl, appReputation, azure, blockListed, connectivity, credentialManager, criticalAttackWarning, cswitch, cwg, denc, deviceAndPlatformHealth, dnsProtectionLocation, downloadReputation, endpointFirewall, fenc, forensicSnapshot, general, integrations, isolation, malware, mobiles, mtr, policy, protection, pua, runtimeDetections, security, smc, systemHealth, uav, uncategorized, updating, utm, virt, wireless, xgEmail, ztnaAuthentication, ztnaGateway, ztnaResource. |
severity | query | array of string | No | Alerts for a specific severity level. You can query by severity levels. Each item must be one of: high, medium, low. |
ids | query | array of string (uuid) | No | List of IDs. |
fields | query | array of string | No | The fields to return in a partial response. |
pageSize | query | integer | No | The size of the page requested. |
pageFromKey | query | string | No | The key of the item from where to fetch a page. |
pageTotal | query | boolean | No | Whether the number of pages should be calculated and returned in the response. |
Request samples¶
curl -X GET "https://api-<data-region>.central.sophos.com/common/v1/alerts" -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/alerts",
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/alerts" -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/alerts", 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/alerts", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Page of alerts.¶
Response fields
itemsarray of objectrequiredList of alerts.
Must contain at most 100 items.
Must contain at most 100 items.
Alert object.
Show child attributesHide child attributes
idstring (uuid)requiredAlert ID.
allowedActionsarray of stringActions that you can perform on these alerts.
Each item must be one of:
Each item must be one of:
acknowledge, cleanPua, cleanVirus, authPua, clearThreat, clearHmpa, sendMsgPua, sendMsgThreat.categorystringAlert categories.
Must be one of:
Must be one of:
adSync, applicationControl, appReputation, azure, blockListed, connectivity, credentialManager, criticalAttackWarning, cswitch, cwg, denc, deviceAndPlatformHealth, dnsProtectionLocation, downloadReputation, endpointFirewall, fenc, forensicSnapshot, general, integrations, isolation, malware, mobiles, mtr, policy, protection, pua, runtimeDetections, security, smc, systemHealth, uav, uncategorized, updating, utm, virt, wireless, xgEmail, ztnaAuthentication, ztnaGateway, ztnaResource.descriptionstringAlert description.
groupKeystringAlert group key.
managedAgentobjectShow child attributesHide child attributes
idstring (uuid)requiredAlert source ID.
typestringrequiredSource that triggered the alert.
Must be one of:
Must be one of:
mobile, computer, server, securityVm, utm, accessPoint, wirelessNetwork, mailbox, slec, xgFirewall, ztnaGateway, sensor.namestringName of alert source.
personobjectReference to the associated person on the alert source.
Show child attributesHide child attributes
idstring (uuid)requiredUser ID.
namestringUser name.
productstringProduct types.
Must be one of:
Must be one of:
other, endpoint, server, mobile, encryption, emailGateway, webGateway, phishThreat, wireless, firewall, ztna, cswitch, secureWebservice.raisedAtstring (datetime)When the alert was triggered.
severitystringSeverity levels for alerts.
Must be one of:
Must be one of:
high, medium, low.tenantobjectShow child attributesHide child attributes
idstring (uuid)requiredTenant ID for the alert.
namestringrequiredTenant name.
dataRegionstringThe data region where tenant data is stored.
Must be one of:
Must be one of:
eu01, eu02, us01, us02, us03, ca01, au01, jp01, in01, br01, ae01.typestringAlert type.
pagesobjectrequiredShow child attributesHide child attributes
fromKeystringThe key of the first item in the returned page.
nextKeystringThe key to use when fetching the next page.
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 on all the pages, if pageTotal=true was passed into the request.
maxSizeintegerrequiredThe maximum page size that can be requested.
Errors¶
| Status | Meaning |
|---|---|
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"items": [
{
"id": "a5ded91c-6575-435c-a6b4-64b94f9048ff",
"allowedActions": [
"acknowledge"
],
"category": "updating",
"description": "John-PC is out of date.",
"groupKey": "MSxFdmVudDo6RW5kcG9pbnQ6Ok91dE9mRGF0ZSw1MTMs",
"managedAgent": {
"id": "bb90527d-73a8-4e6e-85c6-20c2e0c5bc6f",
"type": "computer"
},
"person": {
"id": "17dd896f-ee9f-4f7d-a2a2-6a8c0b48ff15"
},
"product": "endpoint",
"raisedAt": "2021-02-12T15:04:53.780",
"severity": "medium",
"tenant": {
"id": "79067fa3-e4d0-4769-a5f7-8d6550b3b68b",
"name": "Acme Corp"
},
"type": "Event::Endpoint::OutOfDate",
"lastCorrelatedAt": "2021-02-12T16:30:45.123Z",
"updatedAt": "2021-02-12T16:30:45.123Z",
"eventCount": 5,
"status": "open"
},
{
"id": "f9415c5f-e0e9-41d7-8126-1956223a66f1",
"allowedActions": [
"acknowledge",
"cleanPua"
],
"category": "updating",
"description": "Generic reputation PUA detected C:\\Temp\\WinExeSvc.exe",
"groupKey": "MSxFdmVudDo6RW5kcG9pbnQ6Ok91dE9mRGF0ZSw1MTMs",
"managedAgent": {
"id": "bb90527d-73a8-4e6e-85c6-20c2e0c5bc6f",
"type": "computer"
},
"person": {
"id": "17dd896f-ee9f-4f7d-a2a2-6a8c0b48ff15"
},
"product": "endpoint",
"raisedAt": "2021-02-12T15:04:53.780",
"severity": "medium",
"tenant": {
"id": "79067fa3-e4d0-4769-a5f7-8d6550b3b68b",
"name": "Acme Corp"
},
"type": "Event::Endpoint::PUADetected",
"lastCorrelatedAt": "2021-02-12T15:04:53.780Z",
"updatedAt": "2021-02-12T15:04:53.780Z",
"eventCount": 1,
"status": "open"
}
],
"pages": {
"nextKey": "2000818931339",
"total": 1,
"items": 2,
"size": 50,
"maxSize": 1000
}
}