Create a client group
const url = 'http://localhost:8000/api/client-groups/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Sprint squad","description":"100–400 m specialists","colour":"tone-recovery"}'};
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/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Sprint squad", "description": "100–400 m specialists", "colour": "tone-recovery" }'Create a team-scoped group. name is required and must be unique within the team (a duplicate returns 400). Membership is managed separately via the /members/ endpoints.
403 when the caller has no active team selected (a transient state, e.g. mid team-switch).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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.
Examples
Create a group
{ "name": "Sprint squad", "description": "100–400 m specialists", "colour": "tone-recovery"}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.
Examplegenerated
name=example&description=example&colour=exampleA 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.
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.
Examples
Sprint squad
{ "id": "b3f1c0a2-0000-4000-8000-000000000001", "name": "Sprint squad", "description": "100–400 m specialists", "colour": "tone-recovery", "member_ids": [ "a1f1c0a2-0000-4000-8000-0000000000aa" ], "member_count": 1, "created_at": "2026-06-10T12:00:00Z", "updated_at": "2026-06-10T12:00:00Z"}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).
Examplegenerated
{ "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).
Examplegenerated
{ "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).
Examplegenerated
{ "detail": "example"}