> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/help-center/help-topics/no-data/auth-scopes-user-id-matching/same-account-multiple-reference-ids-duplicates.md).

# Why does user\_id not match between UI and webhooks?

This is expected behaviour driven by `reference_id`.

Reauth events are emitted only when the same `reference_id` is reused for the same provider account; reconnecting with a different `reference_id` creates a separate user record. On the current API, when the same account reconnects the old user record is deleted and replaced, which can explain UI/webhook mismatches. On the newer API version, same account + same `reference_id` still triggers reauth, but same account + a different `reference_id` keeps both records.

The dashboard UI shows the most recent `user_id`/`reference_id` for an account, while webhooks continue for every active connection, each keeping its original ids. **Always use the `user_id` and `reference_id` from the** [**webhook payload**](https://docs.tryterra.co/health-and-fitness-api/user-authentication/handling-authentication-events) **for data processing.**

Blocking the same account under different `reference_id`s is not natively supported. To detect that an account was connected before:

{% stepper %}
{% step %}
Query the `/athlete` endpoint.
{% endstep %}

{% step %}
Compare the `provider_user_id` (the account's unique id on the provider side).
{% endstep %}

{% step %}
Dedupe or disconnect on your side.
{% endstep %}
{% endstepper %}

Note that for Apple the `provider_user_id` is OS-managed and can change on app reinstalls.
