# Automated way to disable synthetic monitors for a particular time period

**URL:** <https://community.dynatrace.com/t/automated-way-to-disable-synthetic-monitors-for-a-particular-time-period/20798>\
**Category:** Synthetic Monitoring\
**Tags:** synthetic-monitoring\
**Created:** [November 11, 2020, 6:58pm UTC](https://community.dynatrace.com/t/automated-way-to-disable-synthetic-monitors-for-a-particular-time-period/20798 "2020-11-11T18:58:19Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [February 16, 2021, 2:51pm UTC](https://community.dynatrace.com/t/automated-way-to-disable-synthetic-monitors-for-a-particular-time-period/20798/8 "2021-02-16T14:51:02Z")

</div>

@[Antonio S.](https://answers.dynatrace.com/users/9493/view.html)

Script was working very well till now but it is started failing. Can you please help here?

Below is the error I’m receiving,

```auto
"E:\DynaTrace\Scipt.py", line 98, in <module>
    response = restApiGet(domain+"api/v1/synthetic/monitors?tag="+tag+"&Api-Token="+apiToken)
  File "E:\DynaTrace\Script.py", line 15, in restApiGet
    if int(response.headers['X-RateLimit-Remaining']) == 0:
  File "C:\Program Files\Python39\lib\site-packages\requests\structures.py", line 54, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'x-ratelimit-remaining'
waiting for 5 seconds
Reading contents of Error.log file

```

Is it the case that dynatrace API are not passing/using **x-ratelimit-remaining** header is now?

Regards,

AK

---

_[View the full topic](https://community.dynatrace.com/t/automated-way-to-disable-synthetic-monitors-for-a-particular-time-period/20798)._
