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

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
Example
{
  "name": "teamName",
  "type": 0,
  "members": [
    "8dugqGhuRvCBLdZft"
  ],
  "room": {
    "readOnly": true
  },
  "sidepanel": {
    "items": [
      "discussions",
      "channels"
    ]
  }
}
Expand All
object
name
string Required

The team name.

type
integer Required

Privacy of the team (0 - Public, 1 - Private).

members
Array of string

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

string
room
object
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.

Responses
200

OK

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

Success
{
  "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
}
Expand All
object
team
object
_id
string
name
string
type
integer
createdAt
string
createdBy
object
_id
string
username
string
_updatedAt
string
roomId
string
success
boolean
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string