Skip to content

Teams API

All endpoints require admin authentication (token_admin) and the permission indicated for each one.

Teams

List teams

GET /teams

Returns a paginated, sortable, and filterable list of teams, including the department name and team leader name.

Required permission: teams-table

Query parameterTypeDefaultDescription
startnumber0Offset for pagination (first row index)
lengthnumber20Number of rows per page
sortBystringField to sort by (e.g. name, created_at)
sortTypestringSort direction: ASC or DESC
namestringFilter by team name (partial match)
department_idnumberFilter by department ID
admin_idnumberFilter by team leader administrator ID
activenumberFilter by status: 1 = active, 0 = inactive

Response shape:

json
{
  "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 /teams

Creates a new team.

Required permission: teams-add

Request body:

FieldTypeRequiredDescription
namestringYesTeam name (max 50 characters)
descriptionstringNoShort description (max 100 characters; can be empty or null)
admin_idnumberYesID of the administrator who leads this team
department_idnumberNoID of the department; can be null
activenumberNo1 = active (default), 0 = inactive

Example:

json
{
  "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:

ParameterTypeDescription
idnumberTeam ID (required)

Request body (all fields optional):

FieldTypeDescription
namestringTeam name (max 50 characters)
descriptionstringShort description (max 100 characters; can be empty or null)
admin_idnumberID of the new team leader
department_idnumberDepartment ID; can be null
activenumber1 = active, 0 = inactive

Example:

json
{
  "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:

ParameterTypeDescription
idnumberTeam ID (required)

Catalog

Get teams catalog

GET /catalog/teams

Returns 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:

json
[
  {
    "id": 1,
    "name": "Support Alpha",
    "admin_id": 12,
    "department_id": 3,
    "admin_name": "Jane Doe"
  }
]

Permissions Summary

Permission keyUsed byAccess type
teams-tableGET /teamsRead
teams-addPOST /teamsWrite
teams-editPUT /teams/{id}, DELETE /teams/{id}Write
administrators-tableGET /catalog/teamsRead (catalog access)

Envia Admin