Connections

Start connecting a service on its own page

For a service whose connect shape is oauth_redirect. Returns the service's page to open and, for returnTo app, the URL scheme the flow comes back on: the service redirects to Body Lab's registered callback, which hands its query to that scheme for completeLink. The link expires after 10 minutes, and starting again replaces it. The token exchange and any client secret stay on the server.

post/integrations/{provider}/link

Request

  • Base URL: https://bodylab.lol/api/v1
  • URL: https://bodylab.lol/api/v1/integrations/{provider}/link
  • Auth: HTTP bearer

Path parameters

providerstring required

A connected service. Known values: garmin, oura, apple_health. Treat unknown values as "other".

Headers

X-Client-Platformstring

The native client's platform, e.g. ios. Server-side and non-native callers omit it.

X-Client-Versionstring

The native client's own semver version. With X-Client-Platform, a version below that platform's minimum is refused with CLIENT_UPGRADE_REQUIRED (426).

Request body

returnTo'web' | 'app' required

web completes in the browser's Body Lab session; app hands the callback back to the native app.

Response

OK

urlstring uri required

The service's authorization page.

callbackSchemestring nullable required

For returnTo app: the custom URL scheme the callback arrives on. Null for web.

Changes

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