Add clients to a group
const url = 'http://localhost:8000/api/client-groups/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/members/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"client_ids":["a1f1c0a2-0000-4000-8000-0000000000aa","a1f1c0a2-0000-4000-8000-0000000000bb"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/client-groups/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/members/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "client_ids": [ "a1f1c0a2-0000-4000-8000-0000000000aa", "a1f1c0a2-0000-4000-8000-0000000000bb" ] }'Add one or more clients to the group (idempotent). Every client_id must belong to the same team — an unknown or other-team id rejects the whole batch with 400. Returns the updated group.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request body for adding clients to a group: a non-empty list of client UUIDs (all must belong to the same team — enforced in the service).
object
Client UUIDs to add to the group.
Examples
Add two athletes
{ "client_ids": [ "a1f1c0a2-0000-4000-8000-0000000000aa", "a1f1c0a2-0000-4000-8000-0000000000bb" ]}Request body for adding clients to a group: a non-empty list of client UUIDs (all must belong to the same team — enforced in the service).
object
Client UUIDs to add to the group.
Example generated
client_ids=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0Request body for adding clients to a group: a non-empty list of client UUIDs (all must belong to the same team — enforced in the service).
object
Client UUIDs to add to the group.
Responses
Section titled “Responses”A team-scoped client group (#545). name / description / colour
are writable on create + PATCH; the roster (member_ids) is read-only
here — mutate it via the /members/ endpoints. member_count powers
the board column header without a second round-trip.
object
Group name. Required; unique within the team.
Optional free-text description of the group.
Optional UI tint — a design-token key (e.g. tone-recovery) or empty. Cosmetic; the board falls back to a deterministic colour.
UUIDs of the clients in this group (many-to-many).
Number of clients in the group.
Whether the group carries any target range of its own (#2518) — a MetricThreshold row with client_group = this group. Edit them in /api/thresholds/?client_group=<id>.
Precedence of this group’s own target ranges (#2518) for a client in several groups: per metric, the group first in (ranges_priority, created_at, id) order wins — LOWER wins. Not unique (ties fall back to creation order). Read-only here; set it with POST /api/client-groups/ranges-priority/. A new group starts at the bottom.
Example generated
{ "name": "example", "description": "example", "colour": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Example generated
{ "detail": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Example generated
{ "detail": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Example generated
{ "detail": "example"}