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. To create an ABAC-managed private team with abacAttributes, you also need the create-abac-managed-room permission.
While Enforce ABAC across all workspace rooms is on, new private teams must be ABAC-managed and carry every attribute listed in Attributes required in all ABAC rooms.
Creating a team from an existing room with room.id removes that room's ABAC attributes and records the removal in the ABAC audit log. If the room has attributes, you also need the abac-management and manage-abac-admin-rooms permissions or edit-room-abac-attributes in that room.
Changelog
| Version | Description |
|---|---|
| 9.0.0 | Creating a team from an existing room removes the room's ABAC attributes. |
| 9.0.0 | Added the abacAttributes parameter and the skippedMembers response field. |
| 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"
}
}{
"name": "secret-projects-team",
"type": 1,
"members": [
"aB3dE5fG7hJ9kL1mN"
],
"abacAttributes": {
"clearance": [
"secret"
]
}
}The team name.
Privacy of the team (0 - Public, 1 - Private). Any other value is rejected with a 400 error.
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.
Optional. Creates the team as an ABAC-managed private team with these attributes. Map of attribute keys to the values to assign, for example { "clearance": ["secret"] }. Keys and values can contain letters, digits, _ and -. Use 1 to 10 keys, each with 1 to 10 unique values.
Requires ABAC to be enabled and the create-abac-managed-room permission. The team type must be 1 (private); a public team (type 0) is rejected with error-abac-attributes-private-rooms-only, not converted to private. You cannot combine it with room.id, and owner, if sent, must be the caller. You can only assign values returned by GET /api/v1/abac/attributes.listAssignable. You must meet the attributes yourself; otherwise the request fails with error-abac-creator-not-admitted and no team is created. Members who do not meet the attributes are not added and are listed in skippedMembers.
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
}{
"team": {
"_id": "6720f2b4c4d5e6f7a8b9c0e2",
"name": "secret-projects-team",
"type": 1,
"createdAt": "2026-10-28T15:25:40.117Z",
"createdBy": {
"_id": "aB3dE5fG7hJ9kL1mN",
"username": "jane.doe"
},
"_updatedAt": "2026-10-28T15:25:40.117Z",
"roomId": "6720f2b4c4d5e6f7a8b9c0e4"
},
"skippedMembers": [
"john.roe",
"max.poe"
],
"success": true
}Usernames of the requested members who were not added because they do not meet the team's ABAC attributes. Returned only when abacAttributes was sent and at least one member was skipped.
Bad Request
{
"success": false,
"error": "must be equal to one of the allowed values",
"errorType": "error-invalid-params"
}{
"success": false,
"error": "error-abac-not-enabled",
"errorType": "error-abac-not-enabled"
}{
"success": false,
"error": "error-abac-attributes-private-rooms-only",
"errorType": "error-abac-attributes-private-rooms-only"
}{
"success": false,
"error": "error-abac-creator-not-admitted",
"errorType": "error-abac-creator-not-admitted",
"details": {
"cause": "error-only-compliant-users-can-be-added-to-abac-rooms"
}
}{
"success": false,
"error": "error-abac-attributes-room-conversion",
"errorType": "error-abac-attributes-room-conversion"
}{
"success": false,
"error": "error-abac-attributes-owner-must-be-caller",
"errorType": "error-abac-attributes-owner-must-be-caller"
}Present only when a specific attribute or cause is at fault.
Unauthorized
{
"success": false,
"error": "You must be logged in to do this."
}Forbidden
{
"success": false,
"error": "forbidden"
}