# Teams

**URL:** https://heroiclabs.com/docs/hiro/python/teams/
**Summary:** Manage player teams including creation, listing, searching, and team chat functionality.
**Keywords:** teams, hiro
**Categories:** hiro, python, teams

---


# Teams

*The Teams system allows players to collaborate, join groups, and communicate within your game.* Learn more in the [Teams concept guide](../../concepts/teams/_index.md).

## Overview

The Teams system enables your game to:

* Create new teams.
* List and search available teams.
* Facilitate team communication via chat.

## Before You Start

Make sure you have:

* Python project configured with Hiro SDK.
* Nakama system integrated ([guide](../getting-started/_index.md)).

## Working with Teams

### Creating a Team

Create a new team that other players can join:

```py
request = TeamCreateRequest()
request.name = "Example team"
request.desc = "Example description"
request.open = True
request.icon = "icon.png"
request.lang_tag = "en"
request.setup_metadata = "{}"  # Must be a valid JSON string

team = await hiro_client.teams_create(request)
print(team)
```

### Listing Teams

List available teams for players to join:

```py
request = TeamListRequest()
request.cursor = ""
request.location = "UK"
request.limit = 100

team_list = await hiro_client.teams_list(request)
print(team_list)
```

### Searching for Teams

Search for teams by name or short code:

```py
request = TeamSearchRequest()
request.input = "heroes"
request.limit = 100

team_list = await hiro_client.team_search(request)
print(team_list)
```

### Sending Team Chat Messages

Send messages within the team's chat channel:

```py
request = TeamWriteChatMessageRequest()
request.id = "team_1"
request.content = '{"message":"Hey everyone!"}'

channel_message_ack = await hiro_client.teams_write_chat_message(request)
print(channel_message_ack)
```