Hey there,
in that case, each company (A and B) maintains separate, independent User connections:
When the same end user connects their Fitbit/Garmin account to both Company A and Company B through Terra, each company gets their own unique user_id for that wearable account. These are treated as completely separate connections.
In the following example, a connection made to one fitness wearable account (e.g. one Fitbit account, or one Garmin account) will be referred to as 'one User'. You can pass a reference_id to tie back your app user to this connection.
Multiple Users can be created for one individual, also referred to as an End User. Each company operates under their own dev-id (Developer ID), which is your unique identifier for access to the API. This is how Terra identifies you, and ties Users & their data back to you.
Regarding permission withdrawal:
The connections are managed independently per company. If the end user disconnects from Company A, it does not automatically affect Company B's connection.
However, if the user revokes access at the provider level (e.g., through their Fitbit app settings), this would trigger an access_revoked event for both companies since the revocation happens at the wearable provider's side, not Terra's side.