> ## Documentation Index
> Fetch the complete documentation index at: https://auth0-actions-triggers-prototype.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Describes how to enable API access to the Authorization Extension.

# Enable API Access to Authorization Extension

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Auth0 provides two ways to implement role-based access control (RBAC), which you can use in place of or in combination with your API's own internal access control system:

  * [Authorization Core](/docs/manage-users/access-control/rbac)
  * [Authorization Extension](/docs/customize/extensions/authorization-extension)

  The Authorization Core feature set matches the functionality of the Authorization Extension, improves performance and scalability, and provides a more flexible RBAC system than the Authorization Extension.

  Currently, both implement the key features of RBAC and allow you to restrict the custom scopes defined for an API to those that have been assigned to the user as permissions.
</Callout>

Once configured and set up, your extension should contain users, as well as groups, roles, and permissions. You can automate provisioning and query the authorization context of your users in real-time if you enable API access to your extension.

## Enable API access

1. Go to [Auth0 Dashboard > Extensions > Auth0 Authorization](https://manage.auth0.com/#/extensions).
2. To get to **API** section, select your Auth0 tenant name on the top right of the **Authorization Dashboard**, then select **API**.

   <Frame>
     <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-actions-triggers-prototype/docs/images/cdy7uua7fh8z/6cF78dwvbK7Sc0JbuxJF85/fbd895fb6f7338559628ea71b3003f52/click-configuration_select-api.png" alt="Dashboard - Extensions - Authorization Extensions Dashboard - Select API" />
   </Frame>
3. On the **Settings** page, enable the **API Access** switch.

   <Frame>
     <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-actions-triggers-prototype/docs/images/cdy7uua7fh8z/5toxhsSik9EWMnQoK5wTjH/fc40d80a32461e9216f5c69a89e031ec/enable-api-access.png" alt="Dashboard - Extensions - Authorization Extensions Dashboard - Enable API Access" />
   </Frame>
4. Once API Access is enabled, you'll be able to see or control (within the extension) some of the parameters of the tokens issued by the API. You can control the **time to expiration** of the token, as well as view the token's **audience**, **issuer**, and **URL** to access the API.

   <Frame>
     <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-actions-triggers-prototype/docs/images/cdy7uua7fh8z/3WfHXaEyi8FvD8pTDlYQpt/cbe92c5b5f4baf9c35a8c686ff4f511d/api-access-enabled.png" alt="Dashboard - Extensions - Authorization Extensions Dashboard - API Access Enabled" />
   </Frame>

## Access extension API

When you enabled API access to the extension, Auth0 automatically created an API for your use in the [Auth0 Dashboard](https://manage.auth0.com/#/apis). To access the API, you'll need to create a Machine to Machine Application, which is the entity that interacts with the API itself.

### Create applications

1. Navigate to [Auth0 Dashboard > Applications > Applications](https://manage.auth0.com/#/applications), and select **Create Application**. Name your new Application, and choose the **Machine to Machine Application** type. Select **Create** to proceed.
   You'll be redirected to the **Quick Start** page of the Application, where you can customize the living documentation based on the API with which you'll use the Application. Select the API that Auth0 created for your extension (it should be called **auth0-authorization-extension-api** or similar).
   Since this is the first time you're working with the API and Application together, you'll see a message that says, "This application is not authorized for this API." To authorize the application for use with the API, select **Navigate to the API and Authorize**.

   <Frame>
     <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-actions-triggers-prototype/docs/images/cdy7uua7fh8z/UbMM1C6a1GjMIhNlk8cCD/462b9dcd29e5d7f5bbd261490e6a46b0/Dashboard_-_Authorization_Extensions_-_Client_Quick_Start.png" alt="Dashboard - Authorization Extensions - Client Quick Start" />
   </Frame>
2. You'll see a list of Machine to Machine Applications you can use with your API. Enable the switch next to the Application you just created to authorize it.

   <Frame>
     <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-actions-triggers-prototype/docs/images/cdy7uua7fh8z/4WFJ3BhCf2kZjbRWhQ0sCp/38aeb0ca9360fd75bd7d54f897ac1735/Dashboard_-_Authorization_Extension_-_Clients_for_API.png" alt="Dashboard - Authorization Extension - Clients for API" />
   </Frame>

   Once you've authorized the Application, you'll see the **Grant ID**. You can also select the **Scopes** to be granted to the Application. The scopes you grant depends on the endpoints you want to access.
3. If you make any changes to the scopes, select **Update** to save.

   <Frame>
     <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-actions-triggers-prototype/docs/images/cdy7uua7fh8z/2RvMFmLusnUOmBp1uXPh1/a78add868b094d37cec63365f745f196/extensions-auth-api-scopes.png" alt="Dashboard - Authorization Extension Dashboard - Client Scopes" />
   </Frame>

### Get access token

To access the API, you'll need to [ask for and obtain the appropriate token](/docs/get-started/authentication-and-authorization-flow/client-credentials-flow/call-your-api-using-the-client-credentials-flow).

### Call the API

You can call the API via:

* An HTML request
* A cURL command

You can also find detailed information about the endpoints, as well as samples on how to call each endpoint using the three methods above, in the [Authorization Extension API Explorer](https://auth0.com/docs/api/authorization-extension).

You can also refer to the **API Explorer**, which documents everything you can do via command line once you've enabled access to your extension via API.

Select the **Explorer** page for the API documentation.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-actions-triggers-prototype/docs/images/cdy7uua7fh8z/5mwKE5muQHYbXKqYZvWOwR/aa0ecec3e5cb803a105d857f24c8b6b7/api-explorer.png" alt="Authorization Extension API Explorer" />
</Frame>

## Learn more

* [Use Rules with the Authorization Extension](/docs/customize/extensions/authorization-extension/use-rules-with-the-authorization-extension)
* [Import and Export Authorization Extension Data](/docs/customize/extensions/authorization-extension/import-and-export-authorization-extension-data)
