Skip to main content

Error 401

Error 401 Unauthorized is related to the nature of the access token and happens when:

  • You make a properly composed request, but with an invalid access token;
  • You make a properly composed request, but without the access token;

Invalid token​

Your token may be invalid for a number of reasons, among them:

  • Your token is expired;
  • Your token was revoked;
  • Your token comes from a flow not compatible with the service you want to access.

If your token is expired, you can choose to run the Authorization Code flow again or use the Refresh Token flow.

If your token was revoked, just obtain a new token through the Authorization Code flow.

Token from an incompatible flow​

In BTG Id, certain services can only be accessed using the access token generated in the correct flow. When you try to use a service with an access token from an incompatible flow, the server returns 401.

You must make sure you are generating the access token through the correct flow when you get this error.