# How to setup custom alerts for services using the REST API?

**URL:** <https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333>\
**Category:** Alerting\
**Tags:** problems-classic, dynatrace-api\
**Created:** [October 11, 2018, 8:31pm UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333 "2018-10-11T20:31:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanat\_dixit](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@sanat\_dixit](https://community.dynatrace.com/u/sanat_dixit)\
**Post date:** [October 11, 2018, 8:31pm UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/1 "2018-10-11T20:31:08Z")

</div>

I want to setup multiple custom alerts for all services. Is there a way to do this through the REST API?

In my use case I want to track all errors in a service, and have an alert sent when an error occurs.

There is no way to do that as far as I saw. There are error types ‘Server side’, ‘Client side’, ‘HTTP 4xx’, and ‘HTTP 5xx’. If I want to make use of those, its tedious to set this up for all services one by one.

I tried to use the REST API for ‘thresholds’ with ‘timeseriesId’ as ‘com.dynatrace.builtin:service.errorcounthttp5xx’ to setup an alert but got an error back

“Invoke-RestMethod : {“error”:{“code”:400,“message”:“The given timeseries id is not usable for registering a threshold configuration.”}}”

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [October 12, 2018, 6:59am UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/2 "2018-10-12T06:59:19Z")

</div>

Hi,

There is an upcoming feature called ‘Configuration API’ that is in early access stage right now. It allows you to set up metric events (including custom alerts) by using a new consistent config API. See my screenshot below.

If you would like to test it I can enable the config api EAP on your environment. Just write me an email with your environment information and I will enable it for you.

 ![18589-2018-10-12-08-54-59-dynatrace-rest-api-reference.png](https://global.discourse-cdn.com/dynatrace/original/2X/6/664558acdfedea2b463ee4b68bd0d9cbb1f09a7e.png)

best,

Wolfgang

---

<div class="post-metadata">

**Author:** ![bchintapalli](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@bchintapalli](https://community.dynatrace.com/u/bchintapalli)\
**Post date:** [March 26, 2019, 8:28am UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/3 "2019-03-26T08:28:32Z")

</div>

Hi WolfGang,

We are having Dynatrace managed version. How to create custom alerts for specific application using anomaly detection from REST API?

Please let us know as the I cannot see the above screenshot in DT managed REST API

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [March 26, 2019, 4:53pm UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/4 "2019-03-26T16:53:11Z")

</div>

Functionality is identical in Dynatrace Managed, you have to open the API explorer in any of your Dynatrace Managed monitoring environments. You can access your API explorer through the account menu within the Dynatrace environment.

---

<div class="post-metadata">

**Author:** ![bchintapalli](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@bchintapalli](https://community.dynatrace.com/u/bchintapalli)\
**Post date:** [March 27, 2019, 10:33am UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/5 "2019-03-27T10:33:56Z")

</div>

Hi Wolfgang,

Where do I see the anomalydetection API as I am not able to see in my env?

is it based on version?[dt-managed-api.png](https://answers.dynatrace.com/storage/attachments/20135-dt-managed-api.png) PF the attached screenshot for reference.

---

<div class="post-metadata">

**Author:** ![gerald\_madlsper](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerald_madlsper/32/22365_2.png) [@gerald\_madlsper](https://community.dynatrace.com/u/gerald_madlsper)\
**Post date:** [April 12, 2019, 8:16am UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/6 "2019-04-12T08:16:15Z")

</div>

[@Wolfgang B.](https://answers.dynatrace.com/users/12838/view.html)

When will this part of the API be published?

Is there a way to activate a EAP for our cluster?

regards,

Gerald

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [April 15, 2019, 7:54am UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/7 "2019-04-15T07:54:23Z")

</div>

Its in dev right now. I plan that to be available end of summer.

---

<div class="post-metadata">

**Author:** ![vinnu\_arige\_moe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/vinnu_arige_moe/32/8903_2.png) [@vinnu\_arige\_moe](https://community.dynatrace.com/u/vinnu_arige_moe)\
**Post date:** [November 18, 2020, 6:31pm UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/8 "2020-11-18T18:31:35Z")

</div>

Hi Wolfgang,

If we have to setup custom alerting at the technology level for metrics like CPU/GC/threads at the process level, dont see that feature in the config api? do you know if there is any other way of doing this or any plan to implement this

Vinnu

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [November 19, 2020, 7:37am UTC](https://community.dynatrace.com/t/how-to-setup-custom-alerts-for-services-using-the-rest-api/16333/9 "2020-11-19T07:37:32Z")

</div>

You find the necessary api end point under /config/metricEvents
