Create a new public or private team in the workspace.
Permission required: create-team. When you create a team from an existing room by passing room.id, you also need the edit-room permission for that room.
Changelog
| Version | Description |
|---|---|
| 8.7.0 | Enforced room permission checks when creating a team from an existing room. |
| 3.13.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
{
"name": "teamName",
"type": 0,
"members": [
"8dugqGhuRvCBLdZft"
],
"room": {
"readOnly": true
},
"sidepanel": {
"items": [
"discussions",
"channels"
]
}
}{
"name": "teamName",
"type": 0,
"room": {
"id": "6513afeda2f73c7460e18c86"
}
}The team name.
Privacy of the team (0 - Public, 1 - Private).
The user IDs to add to the team when it is created.
The ID of an existing room to use as the team's main room.
List the team's channels or discussions to be displayed in the sidepanel.
The options are discussions and channels.
Set the owner of the team.
OK
Note that the roomId is main room ID of the team.
{
"team": {
"_id": "651619e3a2f73c7460e18cc5",
"name": "teamName",
"type": 0,
"createdAt": "2023-09-29T00:27:15.189Z",
"createdBy": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie"
},
"_updatedAt": "2023-09-29T00:27:15.189Z",
"roomId": "651619e3a2f73c7460e18cc7"
},
"success": true
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}Forbidden
{
"success": false,
"error": "unauthorized"
}