Teams
Listing teams
Teams can be listed on /api/teams endpoint:
[
{
"_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
{
"_id": "it6hQu3YDsSNFSKV",
"name": "John",
"shortName": "Smith",
"country": "ProPlayer",
"logo": "iVBORw0K...",
"game": "cs2",
"extra": {}
}
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:
{
"name": "Team Name",
"shortName": "Short Name",
"country": "Country Code",
"logo": "iVBORw0K...",
"extra": {}
}
| Field | Description |
|---|---|
| name | The name of the team. |
| shortName | The short name of the team. |
| country | The country code of the team in ISO format. |
| logo | The logo of the team in base64 format with metadata removed. |
| game | The game the team is associated with. |
| extra | A 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:
{
"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