# Custom API access Management API

**URL:** <https://community.auth0.com/t/custom-api-access-management-api/72179>\
**Category:** Get Help\
**Tags:** api, management-api, auth0\
**Created:** [October 27, 2021, 2:48pm UTC](https://community.auth0.com/t/custom-api-access-management-api/72179 "2021-10-27T14:48:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalo.hirsch](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gonzalo.hirsch/32/32629_2.png) [@gonzalo.hirsch](https://community.auth0.com/u/gonzalo.hirsch)\
**Post date:** [October 27, 2021, 2:48pm UTC](https://community.auth0.com/t/custom-api-access-management-api/72179/1 "2021-10-27T14:48:12Z")

</div>

We are developing an API (registered in Auth0’s dashboard), and we need to be able to create users in the Dashboard. For this we want to use the Management API.

We have a Machine to Machine application created and configured to use that API. We use the Auth0 client for Node backend, and when creating an instance of the ManagementClient like this:

```auto
var auth0 = new ManagementClient({
  domain: '{YOUR_ACCOUNT}.auth0.com',
  clientId: '{YOUR_NON_INTERACTIVE_CLIENT_ID}',
  clientSecret: '{YOUR_NON_INTERACTIVE_CLIENT_SECRET}'
});

```

We get the error that ‘You need to create a “client-grant” associated to this API’. I don’t see where we need to create that grant.

Thanks!

---

<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:** [October 27, 2021, 6:17pm UTC](https://community.auth0.com/t/custom-api-access-management-api/72179/3 "2021-10-27T18:17:48Z")

</div>

Hi @gonzalo.hirsch,

Welcome to the Auth0 Community!

Have you seen this topic? It goes through how to set up your client grant.

> [@How to generate a Management Api Token Automatically?](https://community.auth0.com/t/how-to-generate-a-management-api-token-automatically/6376):
>
> I’m trying to automate Management API Token generation and I’m getting the following error: error: 'access\_denied', error\_description: 'Client is not authorized to access "https://squid-adm.auth0.com/api/v2/". You might probably want to create a "client-grant" associated to this API. See: https://auth0.com/docs/api/v2#!/Client\_Grants/post\_client\_grants' Here is my request options: method: 'POST', url: 'https://MY DOMAIN/oauth/token', headers: { 'content-type': 'application/json' }, body: { …

---

<div class="post-metadata">

**Author:** ![gonzalo.hirsch](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gonzalo.hirsch/32/32629_2.png) [@gonzalo.hirsch](https://community.auth0.com/u/gonzalo.hirsch)\
**Post date:** [October 27, 2021, 6:36pm UTC](https://community.auth0.com/t/custom-api-access-management-api/72179/4 "2021-10-27T18:36:37Z")

</div>

I ended up solving this. The docs weren’t exactly clear about which API I was meant to set up for Machine to Machine, it was an API that had to be authorized with the Management API, which again, isn’t clear in the Dashboard how to configure it.

---

<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:** [October 27, 2021, 9:11pm UTC](https://community.auth0.com/t/custom-api-access-management-api/72179/5 "2021-10-27T21:11:03Z")

</div>

For future users, this doc: [Register Machine-to-Machine Applications](https://auth0.com/docs/get-started/create-apps/machine-to-machine-apps), may be helpful.

In the section titled “3. Select the API you want to be able to call from your application.”, you should select the Management API if that is the API you are trying to make requests to.

---

<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:** [November 11, 2021, 9:11pm UTC](https://community.auth0.com/t/custom-api-access-management-api/72179/6 "2021-11-11T21:11:30Z")

</div>

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