health-providers

Handle Provider Callback

Handle 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:

  1. Validate OAuth state
  2. Delegate code exchange + token storage to alice
  3. 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

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.

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

Request body

codestring required

Authorization code from OAuth callback

statestring required

State parameter from callback

Response

Successful Response

provider'garmin' | 'whoop' | 'coros' | 'terra' | 'apple_health' required

Health data providers (OAuth connections).

provider_user_idstring required
permissionsstring[] required
status'active' | 'expired' | 'revoked' | 'error' required

Status of a health provider connection.

result'connected' | 'already_connected' | 'recovered'
custom_tokenstring nullable

Changes

No recorded changes to this endpoint across all 1 revision of this API.