I want to do a daily check to see if my Connected App (that is authorized with OAuth2) has a valid authorization and I can query information from the Org using the API.

Is there a way to directly check if the Connected App's authorization has expired or not?

My original idea was to do a simple daily query via REST API (for example, SELECT Id FROM Organization), and if I get the Org Id then I have a valid authorization, and if I get an error like "Invalid Session Id", then I have to re-authorize. However, I was wondering if there was an API Call designed specifically to check if the authorization is valid or not.


  • I would write some code on the external app to handle authorisation failure and then notify. Dec 2, 2021 at 12:51
  • 2
    No, there's no URL specifically designed to check the status of an access token. Performing a query, as you've outlined here, is probably the best option.
    – sfdcfox
    Dec 2, 2021 at 13:41
  • 2
    Introspection endpoint does this. There's important detail in this Q&A.
    – identigral
    Dec 2, 2021 at 17:05


You must log in to answer this question.

Browse other questions tagged .