# Issue with Excluding 401 Response Code from Failures

**URL:** <https://community.dynatrace.com/t/issue-with-excluding-401-response-code-from-failures/49502>\
**Category:** Dynatrace API\
**Tags:** errors, dynatrace-api\
**Created:** [December 27, 2024, 8:37am UTC](https://community.dynatrace.com/t/issue-with-excluding-401-response-code-from-failures/49502 "2024-12-27T08:37:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jatinarora](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jatinarora](https://community.dynatrace.com/u/jatinarora)\
**Post date:** [December 27, 2024, 8:37am UTC](https://community.dynatrace.com/t/issue-with-excluding-401-response-code-from-failures/49502/1 "2024-12-27T08:37:53Z")

</div>

Hi,

I’ve been receiving 401 response codes for a few APIs and would like to exclude this status code, treating it as a success instead. I tried overriding the general parameters and set the HTTP parameter as follows [snip attached], but I’m still seeing requests marked as&nbsp;failures due to the 401 response code. What can be the reason for this?  
&nbsp;

 ![HTTP 401.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/8/48402bc11e7fa215900dd4c32c367d6edfc1097a.png)  
&nbsp;  
Thanks

---

<div class="post-metadata">

**Author:** ![sia\_h](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sia\_h](https://community.dynatrace.com/u/sia_h)\
**Post date:** [December 27, 2024, 9:23am UTC](https://community.dynatrace.com/t/issue-with-excluding-401-response-code-from-failures/49502/2 "2024-12-27T09:23:29Z")

</div>

Are these failed requests throwing exceptions? Dynatrace sometimes marks requests as failed when it detects exceptions, even with successful HTTP status codes. You can verify this in the trace and configure exception rules to ignore specific cases if needed.

For more details, please check scenario 1 in the [relevant KB article](https://community.dynatrace.com/t5/tkb/tkbworkflowpage/tkb-id/troubleshooting/article-id/758) or refer to the&nbsp;[documentation](https://docs.dynatrace.com/docs/observe/applications-and-microservices/services/service-monitoring-settings/configure-service-failure-detection).

---

<div class="post-metadata">

**Author:** ![jatinarora](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jatinarora](https://community.dynatrace.com/u/jatinarora)\
**Post date:** [December 27, 2024, 9:27am UTC](https://community.dynatrace.com/t/issue-with-excluding-401-response-code-from-failures/49502/3 "2024-12-27T09:27:00Z")

</div>

Yes the failed requests are throwing exceptions, and that means i will have to mark all the exceptions [failing with 401] as ignored exceptions?

---

<div class="post-metadata">

**Author:** ![sia\_h](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@sia\_h](https://community.dynatrace.com/u/sia_h)\
**Post date:** [December 27, 2024, 9:43am UTC](https://community.dynatrace.com/t/issue-with-excluding-401-response-code-from-failures/49502/4 "2024-12-27T09:43:19Z")

</div>

Correct.&nbsp;I suggest testing this by ignoring one specific exception first to confirm if this is the root cause.

---

<div class="post-metadata">

**Author:** ![PierreGutierrez](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pierregutierrez/32/5934_2.png) [@PierreGutierrez](https://community.dynatrace.com/u/PierreGutierrez)\
**Post date:** [December 27, 2024, 7:52pm UTC](https://community.dynatrace.com/t/issue-with-excluding-401-response-code-from-failures/49502/5 "2024-12-27T19:52:30Z")

</div>

Hi&nbsp;[@jatinarora](https://community.dynatrace.com/user/81695)

I think that something that may be more useful for the case you indicate is to apply “Success forcing exceptions”

> **[Configure service failure detection in Service Detection v1](https://docs.dynatrace.com/docs/observe/application-observability/services/service-detection/service-detection-v1/configure-service-failure-detection)**
>
> Discover which service error types Dynatrace automatically detects and learn how to adjust failure detection settings to meet your specific requirements.

 ![PierreGutierrez_0-1735328976188.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/c/fcb50be5110e6c2462149f34b61a819820aeb1b3.png)

By configuring the exception class and message, you can make the request be considered successful.  
I hope its helpful 💪
