You can use a combination of multiple Nylas APIs and features to determine an account's sync state:
Method | Delay | Re-authentication criteria |
Webhooks | 10 minutes to 7 hours depending on scopes and provider | Webhook trigger is account.stopped or account.invalid |
API responses that are directly returned by the provider directly like for POST /send | Instantaneous | HTTP status code is 401 or 403 |
Application Accounts - Return an Account API | 10 minutes to 7 hours depending on scopes and provider | Returned sync state is invalid, invalid-credentials or stopped |
In brief, we recommend to prompt the user to re-authenticate immediately when encountering the re-authentication criterion listed above, taking notes of the delay it can take for these to happen.
Also, that accounts with limited/smaller scopes like only email.send or calendar can delay the time it takes to change an account sync state.
Resources
Why is the account stopped or invalid?
Updated
Comments
0 comments
Please sign in to leave a comment.