# How to create a Machine to Machine application with access to Management API and other Custom API

**URL:** <https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605>\
**Category:** Get Help\
**Tags:** api, machine-to-machine\
**Created:** [November 4, 2021, 9:44am UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605 "2021-11-04T09:44:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![santhoshk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/santhoshk/32/32143_2.png) [@santhoshk](https://community.auth0.com/u/santhoshk)\
**Post date:** [November 4, 2021, 9:44am UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605/1 "2021-11-04T09:44:28Z")

</div>

I have created a M2M app which gets me a Management API token to create a New M2M app. But these M2M app needs to be associated with Management API (with necessary scopes). It also needs to associate with our own API .

**Using below command I get the access token from Management API.**  
–url ‘[https://auth.mydomain.com/oauth/token](https://auth.mydomain.com/oauth/token)’   
–header ‘content-type: application/x-www-form-urlencoded’   
–data grant\_type=client\_credentials   
–data ‘client\_id=MQTYxxxxxxeMdcbl8PpVRoBpnwAj’   
–data client\_secret=Nxxxxxxxxxxxxxxxxxxxxxxxx

curl -X POST -H “Content-Type: application/json” -d ‘{“name”:“VENUS-AQS”,“description”:“Some description”,“app\_type”:“non\_interactive”,“allowed\_clients”: ,“grant\_types”:[“client\_credentials”, “refresh\_token”], “is\_first\_party”:true,“oidc\_conformant”:true,“jwt\_configuration”:{“lifetime\_in\_seconds”:36000,“scopes”:{},“alg”:“RS256”},“sso”:false,“cross\_origin\_auth”:false,“sso\_disabled”:false,“custom\_login\_page\_on”:false,“client\_metadata”:{“client\_name”: “MY LLC”, “account\_id”: “S0000001”},“refresh\_token”:{“rotation\_type”:“rotating”,“expiration\_type”:“expiring”,“leeway”:0,“token\_lifetime”:86400,“infinite\_token\_lifetime”:false,“idle\_token\_lifetime”:46500,“infinite\_idle\_token\_lifetime”:false}}’ --url [https://mydomain.us.auth0.com/api/v2/clients](https://mydomain.us.auth0.com/api/v2/clients) --header ‘authorization: Bearer eyJh…’

I would like to know how to get M2M app associated with Management API and API 's what we have created.

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [November 4, 2021, 1:44pm UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605/2 "2021-11-04T13:44:57Z")

</div>

Hi @santhoshk

You need to create a client grant (also from the management API) when you create the M2M application.

John

---

<div class="post-metadata">

**Author:** ![santhoshk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/santhoshk/32/32143_2.png) [@santhoshk](https://community.auth0.com/u/santhoshk)\
**Post date:** [November 5, 2021, 4:31am UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605/3 "2021-11-05T04:31:10Z")

</div>

thanks john I will give it a try

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 5, 2021, 10:19am UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605/4 "2021-11-05T10:19:14Z")

</div>

Let us know if you have any questions down the road!

---

<div class="post-metadata">

**Author:** ![santhoshk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/santhoshk/32/32143_2.png) [@santhoshk](https://community.auth0.com/u/santhoshk)\
**Post date:** [November 5, 2021, 2:22pm UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605/5 "2021-11-05T14:22:08Z")

</div>

Thanks a lot . I am able to create the M2M app with necessary grants and associate them with the API’s

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 5, 2021, 2:34pm UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605/6 "2021-11-05T14:34:26Z")

</div>

Perfect! Glad to hear that!

---

<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 20, 2021, 2:34pm UTC](https://community.auth0.com/t/how-to-create-a-machine-to-machine-application-with-access-to-management-api-and-other-custom-api/72605/7 "2021-11-20T14:34:44Z")

</div>

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