You can use a combination of account management endpoints, API responses and webhooks to determine an accounts authentication state.
|Method||Time from reflect change||Re-auth on action|
|Webhooks||10min to 7 hours, depending on scopes / provider||account.invalid|
|API responses that touch provider directly /send||Instant||http_status 403 response|
|Account Management||10min to 7 hours, depending on scopes||Poll endpoint for sync_state|
Recommended method is to prompt the user to re-authenticate immediately upon:
- Receiving any 403 when hitting the send endpoint
- Receiving an account.invalid webhook
Limited scopes such only email.send or calendar can delay the time it takes to determine an account authentication state.