# Can I export grants of Auth0 Management API using cli?

**URL:** <https://community.auth0.com/t/can-i-export-grants-of-auth0-management-api-using-cli/67691>\
**Category:** Get Help\
**Tags:** grants, cli, export\
**Created:** [August 10, 2021, 2:01pm UTC](https://community.auth0.com/t/can-i-export-grants-of-auth0-management-api-using-cli/67691 "2021-08-10T14:01:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yas](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yas/32/31026_2.png) [@Yas](https://community.auth0.com/u/Yas)\
**Post date:** [August 10, 2021, 2:01pm UTC](https://community.auth0.com/t/can-i-export-grants-of-auth0-management-api-using-cli/67691/1 "2021-08-10T14:01:05Z")

</div>

I configured the Deploy CLI Application based on the official document as below.

> **[Create and Configure the Deploy CLI Application](https://auth0.com/docs/deploy-monitor/deploy-cli-tool/create-and-configure-the-deploy-cli-application)**
>
> Learn how to create and configure the Deploy CLI application for use with the Deploy CLI tool.

then, I want to export this configuration, especially so many permissions, in my local and then I want to import to the other Auth0 tenant.

However, the grants of the Auth0 Management API are not exported. (I got other grants) and I tried exporting from the other Auth0 tenant, but I could not get grants of Management API as well.

export command: `a0deploy export -c config.json -o exportpath -f directory`

Should I configure the Deploy CLI Application at each Auth0 tenant manually again and again? is it cli’s specification?

please tell me if anyone has any information, thanks!

---

<div class="post-metadata">

**Author:** ![marcus.baker](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcus.baker/32/8586_2.png) [@marcus.baker](https://community.auth0.com/u/marcus.baker)\
**Post date:** [August 12, 2021, 1:38am UTC](https://community.auth0.com/t/can-i-export-grants-of-auth0-management-api-using-cli/67691/2 "2021-08-12T01:38:42Z")

</div>

Hi, yes you should be able to export grants for the resource servers (API) in your tenant.

Verify you have the Auth0 Management API is authorized on the Deploy CLI M2M app you created in the tenant.

- Go to Applications \> CLI Deploy m2m app (the one you created)
- Go to API Tab
- Make sure that **Auth0 Management API** is **authorized** and all the permissions are selected.

You can also verify that Auth0 is returning grants from the Management API using the website directly: [Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Client_Grants/delete_client_grants_by_id)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Yas](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yas/32/31026_2.png) [@Yas](https://community.auth0.com/u/Yas)\
**Post date:** [August 23, 2021, 7:23am UTC](https://community.auth0.com/t/can-i-export-grants-of-auth0-management-api-using-cli/67691/3 "2021-08-23T07:23:52Z")

</div>

thank you to reply marcus,

I couldn’t do what you said.  
and I asked Auth0 support and I got the answer that **Auth0 Deploy CLI can not export/import the scopes by itself** , as below.

> So, I have been able to export everything, by exception of the grants that belong to the client that has been used to run the auth0-cli.

> Regarding the client\_id _xxxauth0-deploy-cli-extension-idxxx_ , after investigating with internal teams, this happens due to the fact that we skip exporting of the Deploy CLI’s own client grants because they are not meant to be changed as it can lead to breaking changes.

> In a scenario where you are copying one tenant’s configuration to another tenant, the new tenant should already have the Deploy CLI Tool’s Application created and setup, otherwise you won’t be able to import anything to this tenant.

so, we need the scope of cli-applciation manually for each tenant.

thanks!

---

<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:** [August 23, 2021, 8:06am UTC](https://community.auth0.com/t/can-i-export-grants-of-auth0-management-api-using-cli/67691/4 "2021-08-23T08:06:10Z")

</div>

Perfect! Thanks for sharing it with the rest of community!

---

<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:** [August 26, 2021, 9:55am UTC](https://community.auth0.com/t/can-i-export-grants-of-auth0-management-api-using-cli/67691/5 "2021-08-26T09:55:42Z")

</div>


