Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
47 lines (38 loc) · 1.95 KB

File metadata and controls

47 lines (38 loc) · 1.95 KB

Create New Team

HTTP MethodURLRequires Auth
POST/api/v1/teams.createyes

{% hint style="info" %} Permission required: create-team {% endhint %}

Body Parameters

KeyExample ValueDescription
name*TeamNameThe team name.
type*0 or 1Privacy of the team (0 - Public, 1 - Private).
members["8dugqGhuRvCBLdZft"]The user IDs to add to the team when it is created.
room{ readOnly: true }Additional options used to create the main team channel.
ownerCkCPNcvfmWLqCSet the owner of the team.

Example Call

curl  -H "X-Auth-Token: 8h2mKAwxB3AQrFSjLVKMooJyjdCFaA7W45sWlHP8IzO" \
      -H "X-User-Id: ew28FnZqipDpvKw3R" \
      -H "Content-type: application/json" \
      http://localhost:3000/api/v1/teams.create \
      -d '{ 
            "name": "teamName", 
            "type": 0 }'

Example Response

{
  "team": {
    "_id": "608876e583314b02c8e6d857",
    "name": "teamName",
    "type": 0,
    "createdAt": "2021-04-27T20:41:09.738Z",
    "createdBy": {
      "_id": "FL2fZL4ERhwA3gWiS",
      "username": "some.username"
    },
    "_updatedAt": "2021-04-27T20:41:09.738Z",
    "roomId": "yv9KEJdTFjmerZprx"
  },
  "success": true
}

{% hint style="info" %} roomId is the team's main room's id. {% endhint %}