When a user’s credentials or server settings (for IMAP/ SMTP or Exchange) changes, the account will stop syncing and its status will change 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.
For a simple credentials change, once the user has re-authenticated, account sync simply resumes.
For a server settings change – for example, 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 will be associated with a new account and
account_id, and the Nylas API token returned from re-authentication will point to this account.
Your application must detect this new
account_id and take appropriate measures to invalidate all existing IDs you have cached since they are no longer valid.
Please be sure to revoke any old access tokens you are no longer using with the /oauth/revoke endpoint. If you no longer have access to old access tokens, you can revoke all tokens automatically using the Revoke all tokens endpoint.
A password change usually doesn't create a separate account, but it’s possible that Nylas will autodetect a different mail server during re-authentication. It’s important to be aware of any
account_idchanges for a particular user.
From an application perspective on your end, if you ever detect that the
account_id changes for a user you need to "resync" since all your old object IDs won't be valid any longer.
Updated about a year ago