By using an account's
sync_state, you can determine when the user should reauthenticate their account. A user may need to reauthenticate for a number of reasons. For example, it could be that their password changed, or it may also be that Nylas' access was revoked by the server.
Using the API, there are three ways to find a Nylas account's current
Make poll requests to /account endpoint and check
invalid, the user needs to reauthenticate. The user also needs to reauthenticate if you receive a
401 response instead.
Make poll requests to Account Management endpoints and check
sync_state. The user needs to reauthenticate 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 reauthenticate.