Auth0 Home Blog Docs

"Bad audience" error in /api/v2/tickets/email-verification

auth0
api
management-api

#1

Calling https://rwehresmann.auth0.com/api/v2/tickets/email-verification results in the following error:

{
    "statusCode": 401,
    "error": "Unauthorized",
    "message": "Bad audience: survivorbet.com https://rwehresmann.auth0.com/userinfo"
}

Any idea of what am I doing wrong?


#3

Hey there @rwehresmann!

Are you sure you’re using the right tenant name in your call? It might be the main reason that affect your audience .

When it comes to the request

{
  "client_id":"clientID",
  "client_secret":"XXXX",
  "grant_type":"client_credentials", 
  "audience":"https://[tenant].eu.auth0.com/api/v2/"
}

Let me know if that helps!


#4

Hello @konrad.sopala, thanks for the reply!

You’re right, I changed but now I receive "Insufficient scope, expected any of: create:user_tickets". However, my Auth0 Management API have this scope defined. What should be my next step?

And I would like to ask: api/v2/tickets/email-verification will always go for Auth0 Management API? The error I had before was happening because I tryied to use the audience of a custom API that I created in my Auth0 account.