By using an account's
sync_state, you can determine when the user should re-authenticate their account. A user may need to re-authenticate for a number of reasons. For example, it could be that their password changed, or that Nylas' access was revoked by the server.
There are three ways to find a Nylas account's current
sync_state using the API.
Make poll requests to the /account endpoint and check the
sync_state. If it's
invalid, the user needs to re-authenticate. The user also needs to re-authenticate if you receive a
Make poll requests to the Account management endpoints and check the
sync_state. The user needs to re-authenticate if the value is
Subscribe to Webhooks with the
account.* triggers to stay up to date with account status changes. If you receive
account.invalid, the user needs to re-authenticate.