Teams API
All endpoints require admin authentication (token_admin) and the permission indicated for each one.
Teams
List teams
GET /teamsReturns a paginated, sortable, and filterable list of teams, including the department name and team leader name.
Required permission: teams-table
| Query parameter | Type | Default | Description |
|---|---|---|---|
start | number | 0 | Offset for pagination (first row index) |
length | number | 20 | Number of rows per page |
sortBy | string | — | Field to sort by (e.g. name, created_at) |
sortType | string | — | Sort direction: ASC or DESC |
name | string | — | Filter by team name (partial match) |
department_id | number | — | Filter by department ID |
admin_id | number | — | Filter by team leader administrator ID |
active | number | — | Filter by status: 1 = active, 0 = inactive |
Response shape:
{
"data": [
{
"id": 1,
"name": "Support Alpha",
"description": "First-line support team",
"active": 1,
"department_id": 3,
"admin_id": 12,
"created_at": "2024-01-15T10:00:00.000Z",
"department_name": "Customer Support",
"admin_name": "Jane Doe"
}
],
"recordsTotal": 42
}Create a team
POST /teamsCreates a new team.
Required permission: teams-add
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Team name (max 50 characters) |
description | string | No | Short description (max 100 characters; can be empty or null) |
admin_id | number | Yes | ID of the administrator who leads this team |
department_id | number | No | ID of the department; can be null |
active | number | No | 1 = active (default), 0 = inactive |
Example:
{
"name": "Support Alpha",
"description": "First-line support team",
"admin_id": 12,
"department_id": 3,
"active": 1
}Update a team
PUT /teams/{id}Updates an existing team. Only the fields included in the request body are changed.
Required permission: teams-edit
Path parameters:
| Parameter | Type | Description |
|---|---|---|
id | number | Team ID (required) |
Request body (all fields optional):
| Field | Type | Description |
|---|---|---|
name | string | Team name (max 50 characters) |
description | string | Short description (max 100 characters; can be empty or null) |
admin_id | number | ID of the new team leader |
department_id | number | Department ID; can be null |
active | number | 1 = active, 0 = inactive |
Example:
{
"active": 0
}Delete a team
DELETE /teams/{id}Permanently deletes a team. This does not reassign administrators who were linked to the team.
Required permission: teams-edit
Path parameters:
| Parameter | Type | Description |
|---|---|---|
id | number | Team ID (required) |
Catalog
Get teams catalog
GET /catalog/teamsReturns a lightweight list of all active teams for use in dropdown selectors. This endpoint is consumed by the Administrators module to populate the team_id field when creating or editing an administrator.
Required permission: administrators-table
INFO
This endpoint intentionally requires administrators-table (not teams-table) because it is called from the Administrators view, where any user who can list administrators must also be able to fetch the teams catalog.
Response shape:
[
{
"id": 1,
"name": "Support Alpha",
"admin_id": 12,
"department_id": 3,
"admin_name": "Jane Doe"
}
]Permissions Summary
| Permission key | Used by | Access type |
|---|---|---|
teams-table | GET /teams | Read |
teams-add | POST /teams | Write |
teams-edit | PUT /teams/{id}, DELETE /teams/{id} | Write |
administrators-table | GET /catalog/teams | Read (catalog access) |
