Invalid Credentials
When a user’s credentials or server settings for IMAP/ SMTP or Exchange changes, the account stops syncing and its status changes to invalid-credentials
. For the account sync to resume, you must ask the user to go through the authentication flow again with their new credentials or server settings.
Change in Credentials
Once the user has re-authenticated, the account sync resumes.
Server Settings Change
If the user changes the IMAP/SMTP or Exchange server endpoint, all previously synced Nylas API IDs for the account will be invalidated. The user is then associated with a new account and <ACCOUNT_ID>
. The Nylas API token returned from re-authentication will point to this new account.
Your application must detect this new <ACCOUNT_ID>
and take appropriate measures to invalidate all existing IDs you've cached since they're no longer valid.
Be sure to revoke any former access tokens you are no longer using with the /oauth/revoke endpoint. If you no longer have access to these tokens, you can revoke all tokens automatically using the Revoke all tokens endpoint.
User Accounts from Mail Server
A password change usually doesn't create a separate account, but it’s possible that Nylas will auto-detect a different mail server during re-authentication. It’s important to be aware of any <ACCOUNT_ID>
changes for a particular user.
From an application perspective on your end, if you detect that the <ACCOUNT_ID>
changes for a user, you need to re-sync since all your former object IDs are invalid.