Teams

Prev Next

In Rocket.Chat, teams are a group of channels used to simplify communications. With the Teams API, you can:

  • Create public and private teams.

  • Manage team members by adding and removing them, and updating member information.

  • Convert a team to a channel and add rooms to a team.

For details, refer to the Teams user guide.

The team object

Team endpoints return a team object. A trimmed example from Get Team Info:

{
  "teamInfo": {
    "_id": "607e0d9b49d493189836bfac",
    "name": "Team1",
    "type": 1,
    "createdAt": "2021-04-19T23:09:15.106Z",
    "createdBy": { "_id": "FL2fZL4ERhwA3gWiS", "username": "some.username" },
    "roomId": "Dgh2xwJ3NFKWvKSqY"
  },
  "success": true
}

Fields you use most often:

  • _id: The team ID. Pass it as teamId in requests; most team endpoints also accept teamName.

  • type: 0 for a public team, 1 for a private team.

  • roomId: The team's main channel. It is a regular room, so room and channel endpoints work on it.

  • createdBy: The user who created the team.

Common workflows

Set up a team

  1. Create the team with a name, type, and optional initial members.

  2. Add members, and update a member's roles to make them a team owner where needed.

  3. Add existing channels to the team to bring related conversations under it.

Explore a team's rooms

  1. List your teams or get a team's info to find its teamId.

  2. List the team's rooms or its rooms and discussions.

  3. Update a room in the team, or remove a room to detach it.

Wind a team down

  1. Convert the team back to a channel if the extra structure is no longer needed.

  2. Delete the team, choosing which of its channels to delete with it.

Conventions

  • Most endpoints accept either teamId or teamName. Using teamId is safer because team names can change.

  • A team is built on a main channel: the team object's roomId points to it, and team membership is separate from membership of individual channels in the team.

  • Creating teams requires the create-team permission; managing members and rooms requires team owner rights or admin-level permissions. Each endpoint page lists its required permissions.

  • List endpoints support count, offset, sort, and query query parameters.