# How obtein threshold for every host by API

**URL:** <https://community.dynatrace.com/t/how-obtein-threshold-for-every-host-by-api/43427>\
**Category:** Alerting\
**Tags:** anomaly-detection\
**Created:** [January 2, 2024, 4:20pm UTC](https://community.dynatrace.com/t/how-obtein-threshold-for-every-host-by-api/43427 "2024-01-02T16:20:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DAVID\_MTZ](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@DAVID\_MTZ](https://community.dynatrace.com/u/DAVID_MTZ)\
**Post date:** [January 2, 2024, 4:20pm UTC](https://community.dynatrace.com/t/how-obtein-threshold-for-every-host-by-api/43427/1 "2024-01-02T16:20:38Z")

</div>

Good morning Dynatrace team

Is possible obtein the thresholds that are available for every HOST monitored via API?

I need to obtein one list of every monitored host and the threshold configured for every one. Is possible this? one idea?

Thanks

---

<div class="post-metadata">

**Author:** ![Kor01](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kor01/32/19401_2.png) [@Kor01](https://community.dynatrace.com/u/Kor01)\
**Post date:** [January 2, 2024, 7:20pm UTC](https://community.dynatrace.com/t/how-obtein-threshold-for-every-host-by-api/43427/2 "2024-01-02T19:20:21Z")

</div>

Hi! There isn’t a direct endpoint for this that I’m aware of, but if you string a few calls together you can get the data:

1. Use the [Environment API](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/entity-v2/entity-selector) to get a list of hosts using an Entity Selector. For every host in the environment, a simple `type(“HOST”)` should work
2. Use the [Settings API](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/settings) and hit the&nbsp;[builtin:anomaly-detection.infrastructure-hosts schema](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/settings/schemas/builtin-anomaly-detection-infrastructure-hosts) to get the default Environment level settings. Individual hosts will override this setting if they have anomaly detection defined.
3. Loop through the list of host IDs and make [GET requests to the Settings API](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/settings/objects/get-objects) and passing in the host ID. If the host has anomaly detection settings that differ from the default Environment settings, they will be returned in the results. If not, then its using the default Environment settings.
