> ## Documentation Index
> Fetch the complete documentation index at: https://docs.technicallyfit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Member groups

> Read the ready-made groups of teammates (new this month, regulars, came once and not back, and more) and list the teammates in one.

Once a day TechnicallyFit sorts the teammates who allow it into six ready-made groups, the same
for every organization. Each group has a stable key and a plain definition. Read the size of
every group in one call, then list the teammates in the one you want to act on. A group never
carries pain, injury, body-state or any other health detail, and the groups cannot be edited.

Your key needs `insights:read`. A test key reads test teammates; a live key reads live ones. The
two never mix.

```bash curl theme={null}
curl "$TF_API_BASE/v1/insights/groups/once_and_gone/teammates?limit=50" \
  -H "X-API-Key: $TF_API_KEY"
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

const page = await tf.GET('/v1/insights/groups/{key}/teammates', {
  params: { path: { key: 'once_and_gone' }, query: { limit: 50 } },
});
for (const teammate of page.data) console.log(teammate.teammate, teammate.context_date);
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

page = tf.list_group_teammates("once_and_gone", limit=50)
for teammate in page["data"]:
    print(teammate["teammate"], teammate["context_date"])
```

```json 200 theme={null}
{
  "key": "once_and_gone",
  "as_of": "2026-11-24",
  "count": { "value": 14, "withheld": false },
  "unlisted": 3,
  "data": [
    { "teammate": "member-1042", "home_location": "club-014", "context_date": "2026-11-10" },
    { "teammate": "member-2210", "home_location": null, "context_date": "2026-11-03" }
  ],
  "next_cursor": null
}
```

## The groups

| Key | Who is in it | `context_date` |
| - | - | - |
| `new_this_month` | Joined your organization on TechnicallyFit in the last 30 days. | The day they joined. |
| `regulars` | Trained or visited on at least 2 days in each of the last 4 weeks. | null |
| `once_and_gone` | Trained or visited exactly once, 7 to 29 days ago, and nothing since. | That one day. |
| `slipping` | Has a current [at-risk flag](https://docs.technicallyfit.com/guides/at-risk-teammates.md). | The day the flag opened. |
| `came_back` | Had an at-risk flag that closed in the last 30 days because they came back. | The first day they came back. |
| `ready_for_a_coach` | Logged a session in each of the last 3 weeks and has no coach. | null |

"Visited" means a [check-in](https://docs.technicallyfit.com/guides/visit-check-ins.md) at one of your locations; "trained" means a
session the teammate logged. The rules use fixed thresholds that are the same for every
organization, and read only days that have ended everywhere, so a teammate can join or leave a
group up to two days after the day that moved them. More groups may be added, so handle a key
you do not know.

## Who is counted and who is listed

* A teammate is **counted** only while they allow `usage_insights` for your organization.
* A teammate is **listed** only while they also allow `at_risk`, and only if you have your own id
  for them (a teammate who joined in the app is counted but not listed here).
* `unlisted` is how many teammates are counted but not listed.

Both are read again at every request: a teammate who turns one off, or leaves, is gone from your
next request. Placeholders that were never claimed are never counted.

## Withheld groups

A group smaller than `min_group_size` (5, the same for every organization) is withheld: its
`count` is `{"value": null, "withheld": true}` and it lists no one. When you read one location,
its count is withheld too if the rest of the organization would be a group of 1 to 4. An empty
group is `{"value": 0, "withheld": false}`. Withheld never means zero.

## Read every group

```bash curl theme={null}
curl "$TF_API_BASE/v1/insights/groups?location=club-014" \
  -H "X-API-Key: $TF_API_KEY"
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

const groups = await tf.GET('/v1/insights/groups', { params: { query: { location: 'club-014' } } });
for (const group of groups.data) {
  console.log(group.key, group.count.withheld ? 'withheld' : group.count.value);
}
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

groups = tf.list_groups(location="club-014")
for group in groups["data"]:
    print(group["key"], "withheld" if group["count"]["withheld"] else group["count"]["value"])
```

```json 200 theme={null}
{
  "location": "club-014",
  "as_of": "2026-11-24",
  "min_group_size": 5,
  "data": [
    {
      "key": "new_this_month",
      "definition": "Members who joined your gym on TechnicallyFit in the last 30 days.",
      "count": { "value": 23, "withheld": false }
    },
    {
      "key": "regulars",
      "definition": "Members who trained or visited on at least 2 days in each of the last 4 weeks.",
      "count": { "value": null, "withheld": true }
    }
  ]
}
```

`as_of` is the UTC day the groups were last worked out, or null before the first time.

| Parameter | Meaning |
| - | - |
| `location` | Your own id for a location. Only teammates whose home location it is are counted. Leave it out for every location. |

## List the teammates in a group

```bash curl theme={null}
curl "$TF_API_BASE/v1/insights/groups/ready_for_a_coach/teammates?limit=100" \
  -H "X-API-Key: $TF_API_KEY"
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

// paginate follows next_cursor for you.
for await (const teammate of tf.paginate('/v1/insights/groups/{key}/teammates', {
  params: { path: { key: 'ready_for_a_coach' } },
})) {
  console.log(teammate.teammate, teammate.home_location);
}
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

# paginate follows next_cursor for you.
for teammate in tf.paginate(tf.list_group_teammates, "ready_for_a_coach"):
    print(teammate["teammate"], teammate["home_location"])
```

| Parameter | Meaning |
| - | - |
| `key` | The group, from the table above. |
| `location` | Your own id for a location. Leave it out for every location. |
| `limit` | 1 to 100, 50 by default. |
| `cursor` | The `next_cursor` of the previous page. |

`teammate` is your own id for the teammate, and `home_location` your own id for their home
location (or null).

## Errors

| Status | Code | When |
| - | - | - |
| 400 | `invalid_request` | The key is not one of the groups, or the cursor is not one this endpoint gave you. |
| 403 | `forbidden` | The key does not hold `insights:read` (`details.required_scope`). |
| 404 | `not_found` | No location with that id in your organization and mode, or groups are not available for your organization yet. |

Requests count toward your key's [rate limits](https://docs.technicallyfit.com/guides/rate-limits.md) like any other.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.