# Multi Tenant using Management API V2

**URL:** <https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080>\
**Category:** Get Help\
**Tags:** management-api\
**Created:** [April 3, 2017, 10:46pm UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080 "2017-04-03T22:46:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Ahmed1](https://community.auth0.com/u/Ahmed1)\
**Post date:** [April 3, 2017, 10:46pm UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/1 "2017-04-03T22:46:17Z")

</div>

Hi,  
I am creating a multi tenant SaaS that will use Auth0 as backbone, after i reviewed the Management API v2 i found some limitations so if you please could help me:

1- How can i create a new tenant “Account” using Management API as i see only Get and Update actions?  
2- Can i generate Management API token with scope higher than tenant, i mean global subscription scope?  
3- How can i create a custom DB connection with script using Management API?  
4- Can i set a custom DB connection to be default for all tenants?  
5- How can i create a non interactive api client to manage the tenant using Management API?

my real question would be how to manage the whole subscription using API at a level higher than the tenant “Account”.  
Thanks

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [April 4, 2017, 1:47pm UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/2 "2017-04-04T13:47:18Z")

</div>

Auth0 can handle multi-tenant customer scenarios, within a single Auth0 account. This would eliminate the need to create new accounts and connections. Metadata in the Auth0 User Profile can be used to store Roles, Permissions, and Groups, to cater to users with different permissions in different tenants, e.g:

```
{
  "email": "prashant@auth0.com",
  "app_metadata" : {
    "permissions" : {
      "auth0" : {
        "role" : "admin"
      },
      "sharelock" : {
        "role": "user"
      }
    }
  }
}  

```

The following doc provides more information on how Auth0 can be used in a multi-tenant scenario:

> **[Multi-Tenant Applications Best Practices](https://auth0.com/docs/get-started/auth0-overview/create-tenants/multi-tenant-apps-best-practices)**
>
> Describes best practices for how to use Auth0 to secure your multi-tenant applications.

---

<div class="post-metadata">

**Author:** ![Ahmed1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Ahmed1](https://community.auth0.com/u/Ahmed1)\
**Post date:** [April 8, 2017, 5:51am UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/3 "2017-04-08T05:51:52Z")

</div>

Thanks, @prashant for your replay,  
The architecture you send it considering that “Tenant = Client = App” while what i meant was “Tenant = Account = Multiple Apps” here the many difference is that we are going to provide SSO service to our customers that each one of them has multiple apps it is the same model that is provided here in Auth0 dashboard as your subscription is multi-account or multi-tenant.

So i am searching how to manage the subscription through API not only at account scope but higher than this as whole subscription scope.

I hope i can get some help on this.

---

<div class="post-metadata">

**Author:** ![Ahmed1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Ahmed1](https://community.auth0.com/u/Ahmed1)\
**Post date:** [April 10, 2017, 11:25pm UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/4 "2017-04-10T23:25:03Z")

</div>

Hi,

Any suggestions?

---

<div class="post-metadata">

**Author:** ![Ahmed1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Ahmed1](https://community.auth0.com/u/Ahmed1)\
**Post date:** [April 8, 2017, 5:51am UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/5 "2017-04-08T05:51:52Z")

</div>

Thanks, @prashant for your replay,  
The architecture you send it considering that “Tenant = Client = App” while what i meant was “Tenant = Account = Multiple Apps” here the many difference is that we are going to provide SSO service to our customers that each one of them has multiple apps it is the same model that is provided here in Auth0 dashboard as your subscription is multi-account or multi-tenant.

So i am searching how to manage the subscription through API not only at account scope but higher than this as whole subscription scope.

I hope i can get some help on this.

---

<div class="post-metadata">

**Author:** ![Ahmed1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@Ahmed1](https://community.auth0.com/u/Ahmed1)\
**Post date:** [April 10, 2017, 11:25pm UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/6 "2017-04-10T23:25:03Z")

</div>

Hi,

Any suggestions?

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [April 12, 2017, 8:44am UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/7 "2017-04-12T08:44:02Z")

</div>

We don’t currently have an API to manage your subscription as a whole. Our Management API does have the Update Tenant Settings endpoint which allows you to fine-tune settings on a tenant level.

> **[Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Tenants/patch_settings)**

---

<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:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/multi-tenant-using-management-api-v2/6080/8 "2018-03-02T05:53:02Z")

</div>


