Suggested connection lifecycle
Junction provides two webhook events for the connection lifecycle:provider.connection.errorindicates that a connection has entered an error state and requires attention.provider.connection.createdindicates that a provider was connected successfully.
1
Handle the connection error event
Use
user_id or client_user_id to identify the user and data.provider to identify the affected provider. The event also includes an error_type, message, and error_details for diagnosis.Error types are non-exhaustive, so implementations should accept values they do not recognize.2
Prompt the user to reconnect
Use the event to present a reconnection option at the point that makes sense for your product. Explain that the connection needs attention and provide a way to reconnect it.Follow the Junction Link flow and generate a new Link token for the existing Junction user. The provider can be passed when generating the token to open Link directly to the relevant connection flow.
3
Handle the successful connection event
Use
provider.connection.created to recognize that the provider was connected successfully and update your application’s connection experience as appropriate.Your connection needs attention. Reconnect your device or account to resume syncing.The exact notification channel, application state, and reconnection experience are up to your implementation.
Reconcile connection status
The Get User Connections endpoint returns the current providers for a Junction user, including whether each connection isconnected or in an error state.
You can use this endpoint when you need to:
- Confirm the current state before presenting a reconnection prompt.
- Refresh connection state when a user opens your application.
- Reconcile your records after webhook delivery or processing failures.
- Periodically check connection state if that fits your application’s requirements.