# How to use the User management APIs - what is the bearer field value?

**URL:** <https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527>\
**Category:** Open Q&A\
**Tags:** user-management\
**Created:** [May 19, 2021, 10:06pm UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527 "2021-05-19T22:06:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidePiras](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/davidepiras/32/29341_2.png) [@DavidePiras](https://community.dynatrace.com/u/DavidePiras)\
**Post date:** [May 19, 2021, 10:06pm UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527/1 "2021-05-19T22:06:31Z")

</div>

I am trying to use the user management APIs, as they are shown in this page:

> **[Dynatrace Account Management API](https://api.dynatrace.com/spec/#/User%20Management/UsersController_getUsers)**

when i click authorize at the top right it ask for a bearer, http, what is that?

should i enter a PAT, an API token or what exactly?

i also went to th eaccount management APIs section and generated client ID and secret, but as per your documentation, i am having issues to generate the Token from there, you have this snippet in there, is this snippet correct? does not look correct to me, why there is this strange string at the end on the parameters list:&nbsp;%3Adtaccount% ?

POST /sso/oauth2/token HTTP/1.1  
Host: [sso.dynatrace.com](http://sso.dynatrace.com)  
Content-Type: application/x-www-form-urlencoded

grant\_type=client\_credentials&client\_id={your client id}&client\_secret={your client secret}&scope=account-idm-read+account-idm-write&resource=urn%3Adtaccount%{your account UID}

---

<div class="post-metadata">

**Author:** ![ryan\_hess](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@ryan\_hess](https://community.dynatrace.com/u/ryan_hess)\
**Post date:** [May 21, 2021, 9:08pm UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527/2 "2021-05-21T21:08:51Z")

</div>

Hi davide\_piras,

The resource parameter is simply to let dynatrace SSO know that the token will be scoped to a particular account as users can be on multiple accounts.&nbsp; What you see is URL encoded.&nbsp; It will look something like this:&nbsp;&nbsp;urn:dtaccount:00000000000-0000-0000-000000-0000000000000 where the “0”'s would be replaced with our account UUID.&nbsp; Once you make the request you will get a JSON payload payload with a field called “access\_token”.&nbsp; You can copy this and paste it into the the swagger and run the request.

Thanks,

Ryan

---

<div class="post-metadata">

**Author:** ![DavidePiras](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/davidepiras/32/29341_2.png) [@DavidePiras](https://community.dynatrace.com/u/DavidePiras)\
**Post date:** [May 22, 2021, 9:47am UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527/3 "2021-05-22T09:47:26Z")

</div>

Thanks Ryan, the documentation page doesn’t only have that error, also the scope to be used is not:

scope=account-idm-read+account-idm-write

but the correct value is:

scope=account-idm-read account-idm-write

without a plus,

I got help from the consultant in the in-product chat, i understand url is encoded but as it is not clickable anyway and values should be replaced, that page would be more helpful if explaining clearly in details which value in each parameter for instance with a screenshot from Postman, SoapUI or whatever other http client…

anyway all worked now for me and i could successfully retrieve that token.

Thanks,

Davide

---

<div class="post-metadata">

**Author:** ![ryan\_hess](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@ryan\_hess](https://community.dynatrace.com/u/ryan_hess)\
**Post date:** [May 25, 2021, 3:01pm UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527/4 "2021-05-25T15:01:55Z")

</div>

Hi Davide,

I really appreciate the feedback.&nbsp; I’ll take this back to the team and see if we can come up with some simpler explanation.

Cheers!

Ryan

---

<div class="post-metadata">

**Author:** ![Duran\_Narbona](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/duran_narbona/32/22405_2.png) [@Duran\_Narbona](https://community.dynatrace.com/u/Duran_Narbona)\
**Post date:** [September 27, 2023, 2:30pm UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527/5 "2023-09-27T14:30:25Z")

</div>

Hi, I have the same problem, is not working for me

> **[Authenticate to Account Management with OAuth clients](https://docs.dynatrace.com/docs/manage/account-management/identity-access-management/oauth)**
>
> Manage authentication and user permissions for the Account Management API.

 ![Screenshot 2023-09-27 at 16.28.55.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/22e39a007b1e894e0a973f7603adcf7b47689a65.png)

---

<div class="post-metadata">

**Author:** ![MarwanC](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marwanc/32/34480_2.png) [@MarwanC](https://community.dynatrace.com/u/MarwanC)\
**Post date:** [June 4, 2025, 3:53pm UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527/6 "2025-06-04T15:53:21Z")

</div>

I guess you have already solved this, but this for the file:

Simple as Windows Batch file

curl -X POST “[https://sso.dynatrace.com/sso/oauth2/token](https://sso.dynatrace.com/sso/oauth2/token)” ^  
-H “Content-Type: application/x-www-form-urlencoded” ^  
-d “grant\_type=client\_credentials” ^  
-d “scope=THE\_SCOPE\_THAT\_IS\_NEEDED\_FROM\_THE\_API\_SWAGGER\_PAGE” ^  
-d “client\_id=dt0s02.GU3CXFD6” ^  
&nbsp;“client\_secret=OBTAINED\_AFTER\_CREATION\_OF\_OAUTH” ^  
-d “resource=OBTAINED\_AFTER\_CREATION\_OF\_OAUTH”

You should get a response like this

C:\Users\1026014\>curl -X POST “[https://sso.dynatrace.com/sso/oauth2/token](https://sso.dynatrace.com/sso/oauth2/token)” -H “Content-Type: application/x-www-form-urlencoded” -d “grant\_type=client\_credentials” -d “scope=environment-api:entities:read” -d “client\_id=dt0s02.GU3CXFD6” -d “client\_secret=CLINET\_SECRET” -d “resource=urn:dtaccount:74a359b4-9323-4b88-9649-d1245f95cfe7”{“scope”:“environment-api:entities:read”,“token\_type”:“Bearer”,“expires\_in”:300,“access\_token”:“YOUR\_BEARER\_TOKEN”,“resource”:“YOUR\_URN”} "Creation Date: 04-06-2025"Hope this helps!Anybody having issues with OAUTH tokens that want to share, as some API do not work anymore with OAUTH Bearer tokens.

---

<div class="post-metadata">

**Author:** ![MarwanC](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marwanc/32/34480_2.png) [@MarwanC](https://community.dynatrace.com/u/MarwanC)\
**Post date:** [June 4, 2025, 3:55pm UTC](https://community.dynatrace.com/t/how-to-use-the-user-management-apis-what-is-the-bearer-field-value/31527/7 "2025-06-04T15:55:01Z")

</div>

Indeed the format of the scope space separated format.
