For the complete documentation index, see llms.txt. This page is also available as Markdown.

Why are there multiple Terra users for one reference_id?

A single provider account maps to exactly one Terra user.

A single provider account maps to exactly one Terra user. Multiple Terra users for the same reference_id and provider occur when two different provider accounts are authenticated under that reference_id. Each distinct provider account gets its own Terra user by design.

If two Terra user IDs appear to receive identical data from the same device, the likely cause is a logging error on your side, or both users authenticating the same provider account.

  • To clean up: deauthenticate the stale user via /auth/deauthenticateUser.

  • To prevent it: check existing active connections via List Users before initiating auth.

For Apple Health specifically, provider_user_id identifies the same device and stays stable as long as the same app (same vendor and package) remains installed. It resets on uninstall/reinstall, which is why reinstalling between test connections yields different IDs.

Last updated

Was this helpful?