Reconnection Widget
Overview
Bank connections linked on Aerosync can stop working either because the user's consent naturally expired or because the user explicitly revoked access. As an integrator, you should treat both as explicit connection states and wire your UX and backend logic around them.
The reconnection widget can be used to allow your end user to link their exact bank account again.
Why Bank Connections Stop Working
Time / Consent-Based Expiry
This is when the underlying bank or data provider no longer considers the user's consent valid, typically after a fixed time window, even if things were working before.
Aerosync will surface this as a distinct status (for example, FAILURE) on the connection.
What happens in this state:
- You should stop attempting to refresh or pull new data for that connection
- The connectionId and account IDs will remain stable so your own references and historical data continue to work
- Your systems should treat the account as "known but inactive" rather than deleted
How to handle it:
- Use the connection status to display a "Reconnect your bank" or similar CTA in your UI instead of failing silently
- When the user chooses to reconnect, send them through your normal Aerosync bank-linking/authorization flow
- On success, Aerosync will associate the updated authorization with the existing connectionId and account IDs whenever the underlying account matches, so you do not need to manage multiple IDs for the same account
- Once reconnected, the status transitions back to ACTIVE and you can resume refreshes and data pulls as normal
User-Initiated Revocation
This is when the user explicitly removes your app's access (for example, in their bank app or a data-sharing dashboard). Technically this also invalidates access, but the intent is different and should be surfaced differently to your users.
Aerosync will expose a separate status (for example, REVOKED_BY_USER) to indicate that the user actively removed access.
What happens in this state:
- You must stop all attempts to refresh or fetch data for that connection
- The connectionId and account IDs remain, but no new data is available
- You should not treat this as a transient error; it is a user decision
How to handle it:
- Use the status and reason to display clear messaging such as: "You removed this connection at your bank, so we can't access this account anymore"
How It Works
Happy Path Example
- User has Chase Checking Account 1234
- User presented Reconnection Widget
- User will be directed to reconnect a Chase account
- User must reconnect Chase Checking Account 1234
Unhappy Path Example
- User has Chase Checking Account 1234
- User presented Reconnection Widget
- User will be directed to reconnect a Chase account
- User tries to connect Chase Checking Account 9876
- Error is thrown to end user
- User will be directed to link their exact same bank initially linked
Implementation
The reconnection process follows a straightforward flow: First, check the account status through the /accounts endpoint. If the connection status is FAILURE, retrieve the connectionId and initiate the Reconnection Widget. Once the user completes the reconnection flow through the widget, verify that the connection status has returned to CONNECTED. The steps below walk you through each part of this process.
Step 1: Check Account Status
To determine if a user needs to reconnect their bank account, first call the /accounts endpoint using the user's connection ID. If the bank account status is "FAILURE," you should then present the reconnection widget to the user.
For more details on checking account status, refer to the documentation on Bank Account Details.
Step 2: Configure and Present the Widget
Generate an Aerosync Token
To use the Reconnection Widget, you'll need to generate an Aerosync token with specific parameters. This token authenticates the reconnection request and identifies which connection needs to be restored.
Required parameters:
apiKey- Your Aerosync API keyapiSecret- Your Aerosync API secretaeroPassUserUUID- The user's unique identifier in AerosyncconnectionId- The ID of the expired or revoked connection (obtained from the on-success event when the bank was originally linked)reconnectAttempt- Set totrueto enable reconnection mode
Example token generation request:
https://api-aerosync.readme.io/reference/post_token-widget
POST /token
{
"apiKey": "your_api_key",
"apiSecret": "your_api_secret",
"aeroPassUserUUID": "user_uuid_here",
"connectionId": "conn_uuid_here",
"reconnectAttempt": true
}Initialize the Widget
Once you have the token, configure and initialize the Aerosync widget:
// Save the token and configure the widget
let widgetRef = openWidget({ = {
token: "generated_token_here",
environment: "production", // or "sandbox"
aeroPassUserUuid: "user_uuid_here",
....
});
// launch Aerosync widget with the configuration
widgetRef.launch();The Reconnection Flow
When the widget launches in reconnection mode:
- The user is directed to their specific bank (e.g., Chase)
- The user enters their bank credentials on the bank's login page
- The user completes any required authentication (OTP, etc.)
- The user completes any additional bank-specific verification steps
- The user confirms their account selection
- The connection is restored with the same
connectionId
When the same institution and account are selected, Aerosync will map the new authorization back onto the existing connectionId so your internal references remain intact.
After successful reconnection, the status returns to ACTIVE and your integration can resume normal operation.
Testing in Sandbox
You can test the complete reconnection flow end-to-end in the sandbox environment using our test bank. This walkthrough will help you verify your implementation before going to production.
Step 1: Link a New Bank Connection
First, create a test bank connection to get a connectionId:
- Generate an Aerosync token (without
reconnectAttemptparameter) - Launch the Aerosync widget
- On the bank list page, search for and select "Aerosync Bank (MFA Trigger)"
- Enter the test credentials:
- Username:
mxuser - Password:
correct
- Username:
- Select either the Checking or Savings account
- Confirm your account selection
- Close the widget and capture the
connectionIdfrom theonSuccessevent
Important: Make note of which account type (Checking or Savings) you selected - you'll need to select the same one during reconnection.
Step 2: Test the Reconnection Flow
Now simulate a reconnection scenario:
- Generate a new Aerosync token with the reconnection parameters:
{
"apiKey": "your_api_key",
"apiSecret": "your_api_secret",
"aeroPassUserUUID": "user_uuid_here",
"connectionId": "conn_from_step_1", // Use the connectionId from Step 1
"reconnectAttempt": true
}- Launch the widget with the new token
- The widget will automatically display the "Aerosync Bank (MFA Trigger)" login page - you won't need to search for it
- Enter the same test credentials:
- Username:
mxuser - Password:
correct
- Username:
- Select the same account type you chose in Step 1 (Checking or Savings)
- ✅ Selecting the same account = successful reconnection
- ❌ Selecting a different account = error (this is expected behavior)
- Confirm your account selection
- Close the widget
Expected Result: The bank connection is successfully re-established with the same connectionId.
Demo
Updated about 2 months ago