# Create Organization in rules

**URL:** <https://community.auth0.com/t/create-organization-in-rules/62057>\
**Category:** Get Help\
**Tags:** organizations, rule, hooks\
**Created:** [May 1, 2021, 7:11pm UTC](https://community.auth0.com/t/create-organization-in-rules/62057 "2021-05-01T19:11:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [May 4, 2021, 12:22pm UTC](https://community.auth0.com/t/create-organization-in-rules/62057/3 "2021-05-04T12:22:30Z")

</div>

Hi @ali.sabryali7,

Welcome to the Community!

> [@ali.sabryali7](#):
>
> Is it possible to create a management api access Token to call management api from the rules usign M2M application credentials?

Yes, in fact, there is a cached Access Token rules can access which you can read about in the [docs](https://auth0.com/docs/rules/use-management-api). However, the scope is limited to `read:users` and `update:users`:

> The Access Token for the Management API, which is available through `auth0.accessToken` , is limited to the `read:users` and `update:users` scopes

Since you need the scope `create:organizations`, you would need to create a new machine-to-machine (M2M) application and authorize it to use the Management API with the `create:organizations`.  
This answer outlines the steps for creating the M2M and writing the rule: [Prevent user creation (with hook?) if user is not whitelisted with rule - #5 by stephanie.chamblee](https://community.auth0.com/t/prevent-user-creation-with-hook-if-user-is-not-whitelisted-with-rule/62000/5)

> [@ali.sabryali7](#):
>
> Is it possible to create a management api access Token to call management api from the hooks (pre-register) usign M2M application credentials?

Yes, you would also create a M2M application just like you would for a rule described above.

> [@ali.sabryali7](#):
>
> Can this flow be implemented using the NEW organization auth0 feature ?

It sounds like it might be possible, but I will have to do some research to know for sure. I see that you have a ticket for this as well, so I will update here when resolved.

---

_[View the full topic](https://community.auth0.com/t/create-organization-in-rules/62057)._
