# Why am I getting invalid token when using client cred to get Management API (/api/v2/users/)

**URL:** <https://community.auth0.com/t/why-am-i-getting-invalid-token-when-using-client-cred-to-get-management-api-api-v2-users/70045>\
**Category:** Get Help\
**Created:** [September 21, 2021, 6:43pm UTC](https://community.auth0.com/t/why-am-i-getting-invalid-token-when-using-client-cred-to-get-management-api-api-v2-users/70045 "2021-09-21T18:43:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgleason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jgleason/32/25904_2.png) [@jgleason](https://community.auth0.com/u/jgleason)\
**Post date:** [September 21, 2021, 6:43pm UTC](https://community.auth0.com/t/why-am-i-getting-invalid-token-when-using-client-cred-to-get-management-api-api-v2-users/70045/1 "2021-09-21T18:43:36Z")

</div>

I am getting a Client Cred token like this…

```auto
curl --location --request POST 'https://dev-91w9x39h.us.auth0.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=...' \
--data-urlencode 'client_secret=...' \
--data-urlencode 'audience=https://dev-91w9x39h.us.auth0.com/api/v2/

```

I get a access token back but when I try using it to call the API like…

```auto
curl --location --request GET 'https://dev-91w9x39h.us.auth0.com/api/v2/users/google-oauth2|109230191017148685...' \
--header 'Authorization: Bearer <token>' \

```

I get

```auto
{
    "statusCode": 401,
    "error": "Unauthorized",
    "message": "Invalid token",
    "attributes": {
        "error": "Invalid token"
    }
}

```

What am I missing? This is using a Regular Web App but that is the way they are signing in so I am not sure how to make a regular app act like a m2m app.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 21, 2021, 9:34pm UTC](https://community.auth0.com/t/why-am-i-getting-invalid-token-when-using-client-cred-to-get-management-api-api-v2-users/70045/2 "2021-09-21T21:34:57Z")

</div>

Hi @jgleason,

Have you tried decoding the token with [jwt.io](http://jwt.io)? You can take a look at the contents and see if anything looks off.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 23, 2021, 4:59pm UTC](https://community.auth0.com/t/why-am-i-getting-invalid-token-when-using-client-cred-to-get-management-api-api-v2-users/70045/4 "2021-12-23T16:59:05Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
