How do I re-authenticate an account?

Chris Aylott
Chris Aylott
  • Updated

You received webhook: account.stopped or account.invalid. The /a/client_id/accounts/id endpoint returns a sync_stateof:

  • invalid-credentials
  • stopped

See: https://developer.nylas.com/docs/the-basics/manage-accounts/account-sync-status/#account-management 

Resolution:

From the Dashboard:

  • Go to any account from the dashboard that you would like to re-authenticate. You will see a Generate a new token button. By clicking this button, you will re-authenticate your account and get the new Access Code after the successful authentication. Make sure to save the Access Code somewhere for calling the API later.

 


Hosted Authentication via API (used by 80% of the apps)

  • Call /oauth/authorize endpoint direct for getting a redirect URL for authentication. Then following the process to get a code back. Using the code in the payload to call /oauth/token endpoint for exchanging a new Access Code for calling the API later.

Native Authentication via API (less common)

 

Re-Auth:

Best Practice Account Re-Authentication 

  1. Start by authenticating the account 
  2. Then using attribute keep_access_token call /revoke-all endpoint ensuring to only keep the most recent token. This will ensure that you are using the correct token.
  3. If using scheduler ensure you update the token by visiting https://api.schedule.nylas.com/manage/pages with the newly generated token. For more info see our documentation.

 

 

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.