# Grant\_type for inviting user to an organization?

**URL:** <https://community.auth0.com/t/grant-type-for-inviting-user-to-an-organization/103644>\
**Category:** Get Help\
**Tags:** organizations-management-api, management-api\
**Created:** [March 29, 2023, 2:29pm UTC](https://community.auth0.com/t/grant-type-for-inviting-user-to-an-organization/103644 "2023-03-29T14:29:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafael-kennedy-IM](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rafael-kennedy-im/32/45885_2.png) [@rafael-kennedy-IM](https://community.auth0.com/u/rafael-kennedy-IM)\
**Post date:** [March 29, 2023, 2:29pm UTC](https://community.auth0.com/t/grant-type-for-inviting-user-to-an-organization/103644/1 "2023-03-29T14:29:05Z")

</div>

I have an application which has Organization Settings set to “Team members of organizations”. I want to request a management API token so that I can invite new members to the organization in response to actions users take in the app, but I cannot do this from that client (client\_credentials is disallowed). I can use a different m2m client, but then I get an error message saying “organizations is not allowed for this client”. Is there any way to achieve this?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 29, 2023, 5:48pm UTC](https://community.auth0.com/t/grant-type-for-inviting-user-to-an-organization/103644/3 "2023-03-29T17:48:05Z")

</div>

Hi @rafael-kennedy-IM,

Welcome to the Auth0 Community!

> [@rafael-kennedy-IM](#):
>
> I want to request a management API token so that I can invite new members to the organization in response to actions users take in the app

This can be accomplished using the [Client Credentials grant flow.](https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-client-credentials-flow)

To do so, start by creating a Machine-to-Machine application and choose the Management API with the necessary permissions to invite users to an Organization (`create:organization_invitations`).

Then when this is complete, you should see the **Quick Start** section of your newly created M2M application that has a code snippet section that you can copy to Get an access token for your API.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/7/379fbc08c5ab67d9a954ca0835af1928da4ae8a5.jpeg)

Executing that code snippet will issue an access token in the response, which you can use with the Management API’s [Create invitations to organization endpoint](https://auth0.com/docs/api/management/v2#!/Organizations/post_invitations).

I recommend checking out our [Get Management API Access Tokens for Production](https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-access-tokens-for-production) documentation for more information.

I hope the explanation was clear!

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![rafael-kennedy-IM](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rafael-kennedy-im/32/45885_2.png) [@rafael-kennedy-IM](https://community.auth0.com/u/rafael-kennedy-IM)\
**Post date:** [March 29, 2023, 6:01pm UTC](https://community.auth0.com/t/grant-type-for-inviting-user-to-an-organization/103644/4 "2023-03-29T18:01:40Z")

</div>

Thank you for your prompt response. This is not actually the problem I was encountering. The problem was that the call to invite user was returning “organizations is not allowed for this client”. I have since realized that I can pass a second client\_id in the body of that call, so the call can be made in the context of the m2m app that allows the client\_credentials grant flow, but be FOR an app that has organizations enabled.

---

<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:** [April 12, 2023, 6:02pm UTC](https://community.auth0.com/t/grant-type-for-inviting-user-to-an-organization/103644/5 "2023-04-12T18:02:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 17, 2023, 6:58pm UTC](https://community.auth0.com/t/grant-type-for-inviting-user-to-an-organization/103644/6 "2023-04-17T18:58:34Z")

</div>

Hi @rafael-kennedy-IM,

Thank you for your response.

The `"Organization is not allowed for this client"` error happens when the Application’s Organization setting has selected **Individuals for personal use** :

 ![image](https://global.discourse-cdn.com/auth0/original/3X/7/e/7ef4b8257d8fec2955873031d6729a2a32707e30.png)

In this situation, I recommend changing the “What types of end-users will access this application?” value in the [Application’s setting page](https://manage.auth0.com/#/applications) (Auth0 Dashboard \> Applications \> Applications \> Your Application \> Organizations tab \> Scroll down to the Organization Settings box) to either **Both** or **Team members of organizations**.

After this is complete, this error should go away. Could you please let me know how this goes for you?

Thanks,  
Rueben
