> 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/faq/help-topics/data-api-sdk/authentication-users-and-connection-state/detect-connection-and-list-users.md).

# How do I detect whether a user connected a wearable?

**Use the `/userinfo` endpoint**, optionally filtering by your `reference_id`, to list a user's connections and all associated `user_id`s. The `is_authenticated` flag tells you whether the [auth flow](https://docs.tryterra.co/health-and-fitness-api/user-authentication/authentication-flow) completed.

Notes:

* For SDK providers, calling `initConnection` creates the connection directly, and if a user fully disconnects, the `user_id` no longer exists.
* Initialising the SDK with a new `reference_id` intentionally creates a new `user_id`, so one physical device can map to several users (payloads return the most recent connection).
* Use the `/athlete` endpoint to see the provider-side account/device ID.
