Create a New Team

Prev Next
Post
/api/v1/teams.create

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
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Create a public team
{
  "name": "teamName",
  "type": 0,
  "members": [
    "8dugqGhuRvCBLdZft"
  ],
  "room": {
    "readOnly": true
  },
  "sidepanel": {
    "items": [
      "discussions",
      "channels"
    ]
  }
}
Create a team from an existing room
{
  "name": "teamName",
  "type": 0,
  "room": {
    "id": "6513afeda2f73c7460e18c86"
  }
}
Create an ABAC-managed private team
{
  "name": "secret-projects-team",
  "type": 1,
  "members": [
    "aB3dE5fG7hJ9kL1mN"
  ],
  "abacAttributes": {
    "clearance": [
      "secret"
    ]
  }
}
Expand All
object
name
string Required

The team name.

type
integer Required

Privacy of the team (0 - Public, 1 - Private). Any other value is rejected with a 400 error.

Valid values[ 0, 1 ]
members
Array of string

The user IDs to add to the team when it is created.

string
room
object
id
string

The ID of an existing room to use as the team's main room.

readOnly
boolean
sidepanel
object

List the team's channels or discussions to be displayed in the sidepanel.

items
Array of string

The options are discussions and channels.

string
Example["discussions", "channels"]
owner
string

Set the owner of the team.

abacAttributes
object

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.

Example{ "clearance": [ "secret" ] }
property*
Array of string additionalProperties
string
Responses
200

OK

Note that the roomId is main room ID of the team.

Team created
{
  "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
}
ABAC-managed private team created
{
  "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
}
Expand All
object
team
object
_id
string
name
string
type
integer
createdAt
string
createdBy
object
_id
string
username
string
_updatedAt
string
roomId
string
skippedMembers
Array of string

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.

string
success
boolean
400

Bad Request

Invalid team type
{
  "success": false,
  "error": "must be equal to one of the allowed values",
  "errorType": "error-invalid-params"
}
ABAC not enabled
{
  "success": false,
  "error": "error-abac-not-enabled",
  "errorType": "error-abac-not-enabled"
}
ABAC attributes on a public team
{
  "success": false,
  "error": "error-abac-attributes-private-rooms-only",
  "errorType": "error-abac-attributes-private-rooms-only"
}
Creator does not meet the ABAC attributes
{
  "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"
  }
}
ABAC attributes with an existing room
{
  "success": false,
  "error": "error-abac-attributes-room-conversion",
  "errorType": "error-abac-attributes-room-conversion"
}
ABAC attributes with another owner
{
  "success": false,
  "error": "error-abac-attributes-owner-must-be-caller",
  "errorType": "error-abac-attributes-owner-must-be-caller"
}
Expand All
object
success
boolean
error
string
errorType
string
details
object

Present only when a specific attribute or cause is at fault.

401

Unauthorized

Authorization Error
{
  "success": false,
  "error": "You must be logged in to do this."
}
object
success
boolean
error
string
403

Forbidden

Missing room permissions
{
  "success": false,
  "error": "forbidden"
}
object
success
boolean
error
string