Getting Bad Audience while calling Custom API for Auth0 User Management

No, when you request the token you need to have your management API as the audience.

For example:

const response = await axios({
    method: 'POST',
    url: `https://{tentant}.auth0.com/oauth/token`,
    headers:{ 'Content-Type': 'application/json'},
    data:{
      client_id: <client_id obtained from newly created API>,
      client_secret: <client_secret obtained from newly created API>,
      audience: `https://{tentant}.auth0.com/api/v2/`,
      grant_type: "client_credentials"
    }
    
 })

The audience param defines what resource is consuming the token. Your custom API (example-API) has nothing to do with this transaction.

1 Like