Terra

Integration

API
Unified API
SDK
SDK
Authentication
Authentication
Streaming
Streaming
Blood
Blood Report API
Planned Workout
Planned Workout
AI Interface
AI Interface

User engagement

Graph API
Graph API
Scores
Health Scores
Rewards
Health Rewards

Use cases

Enterprise
Enterprise
Insurance
Insurance

Developers

Wearable Data
Wearable Data
Community
Community
Documentation
Documentation

Learn

Blog
Blog
Podcast
Podcast
Events
Events
Reports
Reports

Company

Customers
Customers
Careers
Careers
Partners
Partners
Support
Support
Become an integration
Become an integration


Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.

zap

Latest

zap

Popular

API

Unified API

SDK

Phone SDK

Authentication

Widget

Streaming

Streaming

Graph API

Graph API

Duplicated data source for different users

All

PlannedBovid7 months ago

How do I know if same account of wearable has been connected to another user as well. For example, one user connects his Apple Health and he logged out and signed up with another account and connected the same Apple Health with the other account. Terra is sending same data for both users, in this case. This should not be the case and it should revoke the access of first user or let us know. The event user_reauth is not for this purpose, I guess.

terra

Vanessaadmin5 months ago

Hey there,

When the same wearable account is connected again under the same dev_id, Terra handles everything automatically: the previous User record is deleted, and a brand-new User with a new user_id is created. This ensures there is always only one active Terra User per wearable account for your dev_id.

The user_reauth event is different. It fires when the same Terra User reconnects their wearable, not when a wearable account gets connected to a different end user in your system.

To track this cleanly on your side, use the reference_id you pass during authentication. When you receive a new successful auth event, check if that wearable account was previously tied to a different reference_id. Terra will already have removed the old User, so all future data will automatically flow to the new user_id.