API Reference
Teams
Every team, and creating, renaming, recolouring and deleting them.
Every team, and creating, renaming, recolouring and deleting them.
Generated from the OpenAPI spec by
npm run docs:api -w api. Do not edit this page — change the decorators inapps/api/src/and regenerate.
Conventions
- Auth — a session on every route: the cookie on web, the bearer token on mobile. See Authentication.
- Errors — every non-2xx response has the body described in Errors.
- Types — a
?after a field name means it is optional;| nullmeans it is present but may be null.
Endpoints
GET /api/v1/teams — Every team
The whole list, unpaged — there are tens of these, not thousands. Cache it for the session and use it to resolve the team on a profile or directory row.
Returns 200 → TeamResponse[]
| Error | When |
|---|---|
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
POST /api/v1/teams — Create a team
Super admins only.
Body — CreateTeamDto
Returns 201 → TeamResponse
| Error | When |
|---|---|
400 | The request was rejected. message is an array of field errors when validation failed. |
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
PATCH /api/v1/teams/{teamId} — Rename or recolour a team
Super admins only.
| Path parameter | Type | Notes |
|---|---|---|
teamId | string |
Body — UpdateTeamDto
Returns 200 → TeamResponse
| Error | When |
|---|---|
400 | The request was rejected. message is an array of field errors when validation failed. |
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
404 | No such team. |
DELETE /api/v1/teams/{teamId} — Delete a team
Super admins only. Members are not deleted — they are left unassigned, and the response says how many.
| Path parameter | Type | Notes |
|---|---|---|
teamId | string |
Returns 200 → TeamRemovedResponse
| Error | When |
|---|---|
401 | No valid session. Clear the stored token and sign in again. |
403 | Signed in, but not allowed to do this. |
404 | No such team. |
Data models
TeamResponse
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
color | blue | emerald | violet | amber | rose | cyan | orange | slate | A palette token, not a CSS colour — map it to your own styles. |
memberCount | number |
CreateTeamDto
| Field | Type | Notes |
|---|---|---|
name | string | ≤ 60 chars |
color? | blue | emerald | violet | amber | rose | cyan | orange | slate |
UpdateTeamDto
| Field | Type | Notes |
|---|---|---|
name? | string | ≤ 60 chars |
color? | blue | emerald | violet | amber | rose | cyan | orange | slate |
TeamRemovedResponse
| Field | Type | Notes |
|---|---|---|
id | string | |
unassigned | number | People whose team was cleared by the delete. |