- A user resets their password or clicks Sign Out of All Devices, invalidating any access tokens Seam may be using to authenticate to the third-party API.
- The third-party service invalidates access tokens due to excessive usage or as part of a system update.
- An access token used internally by Seam expires.
Reauthorize Before Disconnection
Seam can ask a user to reauthorize while their account is still connected. This can happen when a provider requires new permissions or when an authorization is about to expire. The warning doesn’t mean the account is offline. When Seam requests reauthorization, it adds theaccount_reauthorization_requested warning to the connected account’s warnings array and emits the connected_account.reauthorization_requested event. Subscribe to the event with a webhook to notify the user, and check the connected account’s warnings array for the current state.
To reauthorize, create a new Connect Webview in the same workspace and ask the user to sign in with the same provider account. If the warning’s message includes a deadline, ask the user to complete the flow before then. Seam clears the warning after successful reauthorization.
Detect a Disconnection
To test your application’s recovery flow in a sandbox workspace, use the Simulate Disconnecting a Connected Account endpoint. See the API reference for the request parameters. When an account becomes disconnected, Seam emits aconnected_account.disconnected event. Subscribing to this event through a webhook is the recommended way to detect a disconnection, because it tells you the moment the account needs attention instead of on your next poll.
Seam also records the disconnection on the connected_account itself, so you can inspect the current state at any time. When an account is disconnected, Seam emits an error like the following example on the connected_account:
connected_account.user_identifier to learn the user’s email address. For more information about creating Connect Webviews, see Connect Webview Process.