# HTT 401 Error: Unauthorized Dynatrace Account Management API

**URL:** <https://community.dynatrace.com/t/htt-401-error-unauthorized-dynatrace-account-management-api/44182>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [February 19, 2024, 1:16pm UTC](https://community.dynatrace.com/t/htt-401-error-unauthorized-dynatrace-account-management-api/44182 "2024-02-19T13:16:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [February 19, 2024, 1:16pm UTC](https://community.dynatrace.com/t/htt-401-error-unauthorized-dynatrace-account-management-api/44182/1 "2024-02-19T13:16:10Z")

</div>

Hi,

I’m trying to get information from users using&nbsp;Dynatrace Account Management API without success.

Following this link&nbsp;[Authenticate to Account Management with OAuth clients — Dynatrace Docs](https://docs.dynatrace.com/docs/dynatrace-api/basics/dynatrace-api-authentication/account-api-authentication)&nbsp;I’ve created this request in Postman that generates a bearer successfully:

 ![erh_inetum_0-1708347925622.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/efc96ca02327dfe52ae1941b29195fd8beb7a044.png)

But when I try to get information about the users I get HTTP 401 Unauthorized&nbsp;error:

 ![erh_inetum_1-1708348427091.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/51fb7318e8ef9b3e4da554054f93b6bd23b3ae0f.png)

I get the same error if I lauch this request using swagger:

 ![erh_inetum_2-1708348494989.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/01c7781dcfb54fbbb91864f85395f90c503d0c4e.png)

Does anyone know what is missing?

Thanks in advance.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [February 19, 2024, 1:43pm UTC](https://community.dynatrace.com/t/htt-401-error-unauthorized-dynatrace-account-management-api/44182/2 "2024-02-19T13:43:24Z")

</div>

When creating the OAuth client, you set all the required scope in UI. Then you will get the client\_id, client\_secret and resource.

You then use these values in your POST request to get the access\_token, which is a really long string. No need to set the scopes again there.

Make sure to copy the entire string from “access\_token” value in result json.

From your screenshot, seems you are copying just part of it.

Can you confirm and let us know?

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [February 19, 2024, 1:49pm UTC](https://community.dynatrace.com/t/htt-401-error-unauthorized-dynatrace-account-management-api/44182/3 "2024-02-19T13:49:55Z")

</div>

Hi&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;,

Thanks for your answer.

I confirm you I’m copying the entire string (1094 characters length).

Thanks,

Elena.

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [February 20, 2024, 6:34am UTC](https://community.dynatrace.com/t/htt-401-error-unauthorized-dynatrace-account-management-api/44182/4 "2024-02-20T06:34:28Z")

</div>

Hi,

More information about this.

It’s very strange. Using the same bearer, if I launch this request

```auto
curl -X 'GET' \ 'https://api.dynatrace.com/sub/v2/accounts/xxxxxxxxxxxxxxxxxxx/subscriptions' \ -H 'accept: application/json' \ -H 'Authorization: Bearer MY_BEARER

```

to view my suscriptions, I get HTTP 200 OK but no data is returned:

 ![erh_inetum_1-1708408944847.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/b/7b0ccea3e030ec4d236491a4dc8ff53c851c5111.png)

This is the scope defined:

account-idm-read account-idm-write account-env-read account-env-write account-uac-read account-uac-write iam-policies-management iam:policies:write iam:policies:read iam:bindings:write iam:bindings:read iam:effective-permissions:read app-engine:apps:run settings:objects:read settings:objects:write settings:schemas:read oauth2:clients:manage

Thanks.

---

<div class="post-metadata">

**Author:** ![jcamposaxa](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@jcamposaxa](https://community.dynatrace.com/u/jcamposaxa)\
**Post date:** [June 9, 2026, 4:03pm UTC](https://community.dynatrace.com/t/htt-401-error-unauthorized-dynatrace-account-management-api/44182/5 "2026-06-09T16:03:59Z")

</div>

I have the same problem. Any solution?

Thanks
