Calling Auth0 API inside Actions

Hi @nikhil-varma,

Before we continue, I have some clarifying questions.

First, are you able to follow How can I use the Management API in Actions? FAQ and get the Management API working with Actions?

Currently, it sounds like you are trying to get the Management API to work inside your application, could you please confirm?

If that is the case, you need to make a request similar to the following:

curl --request POST \
  --url 'https://YOUR_DOMAIN.REGION.auth0.com/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data client_id=YOUR_CLIENT_ID \
  --data client_secret=YOUR_CLIENT_SECRET \
  --data audience=YOUR_API_IDENTIFIER

Please verify that you are using the correct values for your client_id, client_secret, and audience.

The audience should reference the Management API in the format https://YOUR_DOMAIN.REGION.auth0.com/api/v2/.

And the client_id and client_secret should match the authorized Machine-to-Machine application with ALL of the Management API permissions.

For example, you can use the M2M application on your Dashboard named API Explorer Application for these values.

I have tested this myself and was able to generate an Access Token to use with the Management API.

Please let me know if there’s anything else I can do to help.

Thank you.

1 Like