Send the user a code
By email or phone.external_user_id is optional: your own id for the user, returned on webhooks so you can match them up.
Verify the code
In sandbox the code is always111111.
user.id is how your server names the user on /api/v2 calls. access_token is the connection token your agent uses. The connection.created webhook fires here.
Record consent
Once per user, before any card or balance action:user_info_required error later means this step was skipped.
Refresh the connection
Connection tokens expire after one hour. Rotate them with the refresh token, using your org token as the bearer:invalid_refresh_token means it was already used or expired: reconnect the user.
Users you know by phone only
Sandbox
Sandbox sends email but not SMS, and the code is always111111. Sandbox users are isolated: connecting anyone@example.com in sandbox can never touch a real account.