---
title: "Start connecting a service on its own page"
method: POST
path: "/integrations/{provider}/link"
tags: ["Connections"]
---

# Start connecting a service on its own page

`POST /integrations/{provider}/link`

## Request

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

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.

## Path parameters

- `provider` string, required: A connected service. Known values: garmin, oura, apple_health. Treat unknown values as "other".

## Headers

- `X-Client-Platform` string
- `X-Client-Version` string

## Request body

- object
  - `returnTo` 'web' | 'app', required: web completes in the browser's Body Lab session; app hands the callback back to the native app.

## Response `200`

OK

- object
  - `url` string, uri, required: The service's authorization page.
  - `callbackScheme` string, nullable, required: For returnTo app: the custom URL scheme the callback arrives on. Null for web.

## Other responses

- `401`: Error: UNAUTHORIZED.
- `409`: Error: LINK_NOT_AVAILABLE, NOT_OFFERED.

---

[API](https://skmtc.dev/bodylab/apis/body-lab-api.md) · [All operations](https://skmtc.dev/bodylab/apis/body-lab-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bodylab/apis/body-lab-api/revisions/544c201eaf88?raw)
