health-providers
Handle Provider Callback
Changed onHandle OAuth callback from health provider.
The app should call this endpoint after receiving the OAuth callback with the authorization code and state parameters. user may be None during first-time onboarding when the caller holds an anonymous Firebase token — identity is resolved via _link_provider_identity.
Flow:
- Validate OAuth state
- Delegate code exchange + token storage to alice
- Resolve mapping via _link_provider_identity (branches on whether the provider identity is new, already-owned, a collision, or recoverable).
post/health-providers/{provider}/callback
Request
- Base URLhttps://api.imperfect.co (the document declares no server; this is the origin it was published from)
- URLhttps://api.imperfect.co/health-providers/{provider}/callback
- AuthHTTP bearer
Path parameters
provider'garmin' | 'whoop' | 'coros' | 'terra' | 'apple_health' required
Health data providers (OAuth connections).
Query parameters
login_onlyboolean
When true, return 404 if the provider identity does not already map to a User. Used by the mobile login flow to avoid auto-creating ghost accounts.
Headers
x-device-timezonestring nullable
x-device-hintstring nullable
x-client-platformstring nullable
Request body
Response
Successful Response
Changes
- info
added the new optional
headerrequest parameterx-client-platform - info
added the new optional
headerrequest parameterx-device-hint
- info