> 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/api-endpoints-errors-and-migrations/sdk-vs-web-providers.md).

# Why does authenticateUser fail for some provider names?

**Providers marked `setup: 'SDK'` in `/v2/integrations/detailed` (Apple Health, Google Fit / Health Connect) cannot be used with `/v2/auth/authenticateUser`, which is web-only.** That's the source of the validation error.

* **For SDK providers**, integrate the Terra mobile SDK and call `initConnection` with a token from `/v2/auth/generateAuthToken`.
* **Web providers** (Fitbit, Garmin, Oura, Withings, Polar, Suunto) work with `authenticateUser` directly.

There's **no automatic migration** from an API-based connection to an SDK-based connection. When a previously API-connected user logs in, call `initConnection` (ideally behind a modal explaining the new permissions). Each user must re-grant permissions through the SDK flow.

See [mobile-only sources](https://docs.tryterra.co/health-and-fitness-api/mobile-only-sources) for SDK integration.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tryterra.co/faq/help-topics/data-api-sdk/api-endpoints-errors-and-migrations/sdk-vs-web-providers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
