---
title: "REST API - How to use the REST API to return a list of managed entities with a warning or critical severity"
description: "The REST API can return a list of managed entities with warning or critical severity states. Severity states are defined by numeric codes, with 2 representing warning and 3 representing critical."
url: "https://docs.itrsgroup.com/docs/faq/geneos/360022734913-geneos-rest-api-how-to-use-the-rest-api-to-return-a-list-of-managed-entities-with-a-warning-or-critical-severity/index.html"
---
To find all managed entities with a severity of warning or critical:

```
curl -u username:password -X GET -s --data '{"target":"//managedEntity[(state(\"severity\")>1)]"}' http://gatewayHost:gatewayPort/rest/xpaths/match | python -m json.tool

[geneos@kamcs7 ~]$ curl -u Web:hello123 -X GET -s --data '{"target":"//managedEntity[(state(\"severity\")>1)]"}' http://kamcs7.cslab.ldn.itrs:9007/rest/xpaths/match | python -m json.tool
{
    "xpaths": [
        "/geneos/gateway[(@name=\"OERH_RMDS_02\")]/directory/probe[(@name=\"Trades\")]/managedEntity[(@name=\"Birmingham\")]",
        "/geneos/gateway[(@name=\"OERH_RMDS_02\")]/directory/probe[(@name=\"Trades\")]/managedEntity[(@name=\"London\")]",
        "/geneos/gateway[(@name=\"OERH_RMDS_02\")]/directory/probe[(@name=\"Trades\")]/managedEntity[(@name=\"Swansea\")]"
    ]
}
```

![Geneos - REST API - How to use the REST API to return a list of managed entities with a warning or critical severity](https://docscdn.itrsgroup.com/faq/images/geneos/360022734913-34717557276701-image.png)

The definition of the severity states can be found here:

[Guide/geneos\_xpath\_ug.html#ExtractRparams](https://docs.itrsgroup.com/docs/geneos/current/processing/gateway-administration/geneos_xpath_ug/index.html#extracting-information) > state attributes
*Severity is a state attributes: 0 = none, 1 = OK, 2 = warning, 3 = critical, 4+ = user.*


