# Get Auth0 Management API invalid token error

**URL:** <https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649>\
**Category:** Get Help\
**Created:** [May 18, 2022, 11:01am UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649 "2022-05-18T11:01:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![conghc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/conghc/32/37404_2.png) [@conghc](https://community.auth0.com/u/conghc)\
**Post date:** [May 18, 2022, 11:01am UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/1 "2022-05-18T11:01:20Z")

</div>

Hi team,

I’m trying to use the Management API to create user but getting following error when calling the create user endpoint with the returned Bearer access token.

“statusCode”:401,“error”:“Unauthorized”,“message”:“Invalid token”,“attributes”:{“error”:“Invalid token”}}

Following this [Get Management API Access Tokens for Production](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-access-tokens-for-production), I successful to get the access token but when decoded it by [jwt.io](http://jwt.io), it seems the access token does not have any permissions. I’m using the client\_id and client\_secret in the Auth0 Management API (Test Application)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/4/0/406f6072d0bbd1a8a9a1f907953b48d6a368d40b.png)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/1/1/115cb99098f08e85fd56469962d2e21ef6a21af8.png)

Could you please advise what possibly causing the problem?

Thank you.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 18, 2022, 5:11pm UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/3 "2022-05-18T17:11:26Z")

</div>

Hi @conghc,

Welcome to the Auth0 Community!

> [@conghc](#):
>
> Following this [Get Management API Access Tokens for Production](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-access-tokens-for-production), I successful to get the access token but when decoded it by [jwt.io](http://jwt.io), it seems the access token does not have any permissions. I’m using the client\_id and client\_secret in the Auth0 Management API (Test Application)

It seems that your “Auth0 Management API (Test Application)” may not be assigned with the required permissions.

In this case, could you please expand your “Auth0 Management API (Test Application)” in your API settings and select **All** the permissions. Please don’t forget to save your changes.

After doing so, you can get the Management API access tokens for production.

Please let me know if you have any additional questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![conghc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/conghc/32/37404_2.png) [@conghc](https://community.auth0.com/u/conghc)\
**Post date:** [May 18, 2022, 9:05pm UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/4 "2022-05-18T21:05:33Z")

</div>

Hi @rueben.tiow,

Thank you for your feedback. The screenshot I took is short might confuse but the API has all the permissions assigned I think

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/2/821d077b870a7d5f15f9c03664b881f980f9cdb7.png)

Sorry can’t take the whole permission page due to the screen resolution but the attached above shows part of permissions.

Please let me know should you need any information.

Thank you.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 18, 2022, 9:22pm UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/5 "2022-05-18T21:22:00Z")

</div>

Hi @conghc,

Thank you for your reply.

You will need to assign them to your application on your Management API \> Machine to Machine Applications \> Auth0 Management API (Test Application) for example:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/9/f93a852563a21e749a7143a38821b4c9e888d1b8.png)

Thank you.

---

<div class="post-metadata">

**Author:** ![conghc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/conghc/32/37404_2.png) [@conghc](https://community.auth0.com/u/conghc)\
**Post date:** [May 18, 2022, 10:08pm UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/6 "2022-05-18T22:08:27Z")

</div>

Hi @rueben.tiow,

Thank you, it works now after added required permission per your instruction.

I would suggest to put a similar screenshot like yours to this step [Register Machine-to-Machine Applications](https://auth0.com/docs/get-started/auth0-overview/create-applications/machine-to-machine-apps) to make the documentation more clearer 🙂 as the collapse icon is quite unnoticeable to the user (or at least to me).

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/1/812b0af9a7001629caea963d4e0207a466b81670.png)

I have skimmed through the docs multiple times but can’t see any place to guide user to click to that collapse icon for adding permissions (or I might be missed it)

A quick one, can I use the Auth0 Management API (Test Application) for Production purpose? Not sure about the postfix Test Application means anything?

Thank you again for your kind support.

---

<div class="post-metadata">

**Author:** ![conghc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/conghc/32/37404_2.png) [@conghc](https://community.auth0.com/u/conghc)\
**Post date:** [May 19, 2022, 10:08pm UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/7 "2022-05-19T22:08:42Z")

</div>

Hi @rueben.tiow ,

Sorry for my nested question, could you please advise if we can use the Auth0 Management API (Test Application) for Production?

What does the “(Test Application mean)”?

Thank you.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 19, 2022, 11:42pm UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/8 "2022-05-19T23:42:39Z")

</div>

Hi @conghc,

Thank you for your responses and feedback.

> [@conghc](#):
>
> can I use the Auth0 Management API (Test Application) for Production purpose?

Yes, this should not be an issue. The only thing I will mention is that the application name is not very informative and could be a source of confusion in the future. With that, you could consider creating a new machine-to-machine application with the desired application name.

> [@conghc](#):
>
> What does the “(Test Application mean)”?

Please see [this thread](https://community.auth0.com/t/why-do-all-of-my-api-applications-say-test-application/29762/4) for an explanation on the “(Test Application)” application name.

Hoped this helps!

Thank you.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [October 6, 2022, 5:41pm UTC](https://community.auth0.com/t/get-auth0-management-api-invalid-token-error/83649/9 "2022-10-06T17:41:58Z")

</div>


