Skip to main content

Teams

Listing teams

Teams can be listed on /api/teams endpoint:

GET /api/teams
[
{
"_id": "it6hQu3YDsSNFSKV",
"name": "John",
"shortName": "Smith",
"country": "ProPlayer",
"logo": "iVBORw0K...",
"game": "cs2",
"extra": {}
}
]

Teams can not be filtered by ids in the same manner as Player, but there is additional endpoint for Teams that allow fetching specific Team.

Fetching single team

GET /api/teams/:id
{
"_id": "it6hQu3YDsSNFSKV",
"name": "John",
"shortName": "Smith",
"country": "ProPlayer",
"logo": "iVBORw0K...",
"game": "cs2",
"extra": {}
}
info

About logos: Currently, LHM sends back information with logos represented as URLs in the local network: http://192.168.50.71:1349/api/teams/logo/ahoYtSlIjhYfI7L3 would be an example. This sometimes causes issues on PCs with some stricter antiviruses. In the future logos will be sent as relative address instead, to mitigate this.

Adding a Team

To add a new team, send a POST request to /api/teams:

POST /api/teams
{
"name": "Team Name",
"shortName": "Short Name",
"country": "Country Code",
"logo": "iVBORw0K...",
"extra": {}
}
FieldDescription
nameThe name of the team.
shortNameThe short name of the team.
countryThe country code of the team in ISO format.
logoThe logo of the team in base64 format with metadata removed.
gameThe game the team is associated with.
extraA record object with string keys and values for additional team metadata.

All fields can be empty strings (beside extra which must be satisfy Record<string, string> type).

Team is automatically assigned to a game that LHM is currently set to.

Modifying a Team

To modify an existing team, send a PATCH request to /api/teams/:id:

PATCH /api/teams/:id
{
"name": "Team Name",
"shortName": "Short Name",
"country": "Country Code",
"logo": "iVBORw0K...",
"extra": {}
}

All of the fields are identical as in the adding team section

Removing a Team

To remove an existing team, send a DELETE request to /api/teams/:id. You can also remove multiple teams in one request by joining their IDs with a semicolon (;).

Example:

DELETE /api/teams/123;456;789

This will remove the teams with _id 123, 456, and 789.

Optionally, you can batch remove all of the player associated with selected teams by adding ?removePlayers=true query:

DELETE /api/teams/12345?removePlayers=true