# Onboarding flows

> The onboarding flows you've set up, to run one for a client you add.

Source: https://hubfit.com/developers/api/onboarding-flows


An onboarding flow is what a coach set up to give a new client in one go, such as their programs, nutrition plans, check-ins, habits, metrics, communities and team members. Pass one's `id` as `onboardingFlowId` when creating a client to run it for them, as adding a client with a flow does in the app.

Endpoints:

- `GET /v1/onboarding-flows`: [List onboarding flows](https://hubfit.com/developers/api/onboarding-flows#list-onboarding-flows)

## Onboarding flow object

### Attributes

- `id` (string): Its unique ID.
- `name` (string)

### Example

```json
{
  "id": "6ad6affacef0fafbcef28df8",
  "name": "12-week fat loss"
}
```

## List onboarding flows

`GET https://api.hubfit.com/v1/onboarding-flows`

Every onboarding flow in the workspace, newest first, to pass one as `onboardingFlowId` when creating a client. A workspace adds no more than 50 (`MAX_ONBOARDING_FLOWS_PER_WORKSPACE`), so they all come in one response, without paging. Requires `clients:create`, which creating a client with one needs.

### Returns

Every onboarding flow in the workspace.

### Example request

cURL:

```bash
curl https://api.hubfit.com/v1/onboarding-flows \
  -H "Authorization: Bearer $HUBFIT_API_KEY"
```

Node.js:

```javascript
const response = await fetch("https://api.hubfit.com/v1/onboarding-flows", {
  headers: {
    Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
  },
});

const { data } = await response.json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://api.hubfit.com/v1/onboarding-flows",
    headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)

data = response.json()["data"]
```

### Example response (200 OK)

```json
{
  "data": [
    {
      "id": "6ad6affacef0fafbcef28df8",
      "name": "12-week fat loss"
    }
  ]
}
```
