# API /api/v1.0/onpremise/users is responding 200 but throws an error

**URL:** <https://community.dynatrace.com/t/api-api-v1-0-onpremise-users-is-responding-200-but-throws-an-error/35326>\
**Category:** Dynatrace API\
**Tags:** python, dynatrace-api\
**Created:** [May 31, 2022, 3:46pm UTC](https://community.dynatrace.com/t/api-api-v1-0-onpremise-users-is-responding-200-but-throws-an-error/35326 "2022-05-31T15:46:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elodie\_lam](https://avatars.discourse-cdn.com/v4/letter/e/ee7513/32.png) [@elodie\_lam](https://community.dynatrace.com/u/elodie_lam)\
**Post date:** [May 31, 2022, 3:46pm UTC](https://community.dynatrace.com/t/api-api-v1-0-onpremise-users-is-responding-200-but-throws-an-error/35326/1 "2022-05-31T15:46:24Z")

</div>

Hi, I’m using python scripts to call the cluster APIs.

The APIs are working fine, they are doing the expected configurations but I have a strange behavior with the last use-case.

As you can see, the API “/api/v1.0/onpremise/users” is responding 200, I can see the configuration applied but is throwing some kind of exception so the GitlabCI job is failing:

 ![elodie_lam_4-1654011788376.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8f1b3d3e524d7960fda097fdb9ebde556c5027e2.png)

 ![elodie_lam_5-1654011802643.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/ec8368b914e710fe029b3626738022d4b2e59670.png)

The code I’m using is the following:

 ![elodie_lam_2-1654011632717.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/f/efdaf160fa58fc9d53ab79615063ce29e42eca6b.png)

 ![elodie_lam_3-1654011632627.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/3002314407db36a1c1f28621df831894fc08472b.png)

I’m using the same mechanism for all API calls in the scripts, for the others the behavior is normal when the call is 200 there is no Error! message. Except in the case I described.

Could you please help me understand why?

Thank you for your help.

Elodie

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [June 8, 2022, 2:14pm UTC](https://community.dynatrace.com/t/api-api-v1-0-onpremise-users-is-responding-200-but-throws-an-error/35326/2 "2022-06-08T14:14:41Z")

</div>

Hi&nbsp;[@elodie\_lam](https://community.dynatrace.com/user/14930),

you are exiting with sys.exit(1) even though there was not error. Usually exit codes != 0 are treated as an error. The pipeline _thinks_ something failed.
