Create a new private channel, optionally including specified users. Refer to the Channels documents for information on the available room options.
The following permissions are required:
create-p: This permission is required to create a private channel.create-team-group: This permission is required if you want to create a private channel from an existing team.
Changelog
| Version | Description |
|---|---|
| 8.8.0 | Added support for enforcing end-to-end encryption when creating private rooms. |
| 6.4.1 | Added excludeSelf param |
| 0.35.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
{
"name": "groupname",
"members": [
"rocket.cat"
],
"readOnly": true,
"excludeSelf": true,
"customFields": {
"type": "default"
},
"extraData": {
"broadcast": true,
"encrypted": true,
"teamId": "658441562dd9f928ad9951aa"
}
}The name of the new private group.
Set if the private channel is read-only or not. The default value is false.
The users to add to the private channel when it is created.
If set to true, the user calling the endpoint is not added as a member of the private channel. The default value is false.
You add custom fields for private rooms using this parameter. Enter the key and value that you want to associate with this room. For example, { "company": "sell-and-more" }. The custom fields are not displayed in the workspace UI.
Enter the following details for the object:
Note: For more information, see Channels.
Whether the group should be a broadcast group. False by default.
Whether the private room should use end-to-end encryption. When Force end-to-end encryption on private rooms is enabled, omit this field or set it to true. Setting it to false returns the error-encrypted-private-rooms-enforced error. Federated private rooms are exempt from this policy.
Enter the team ID for which you want to create a group. You will get an error if the team does not exist.
OK
{
"group": {
"_id": "NtR6RQ7NvzA9ejecX",
"name": "testing",
"t": "p",
"msgs": 0,
"u": {
"_id": "aobEdbYhXfu5hkeqG",
"username": "tester"
},
"ts": "2016-12-09T16:53:06.761Z",
"ro": false,
"sysMes": true,
"_updatedAt": "2016-12-09T16:53:06.761Z"
},
"success": true
}Bad Request
{
"success": false,
"error": "Body param \"name\" is required"
}{
"success": false,
"error": "Workspace policy requires all private rooms to be encrypted. [error-encrypted-private-rooms-enforced]",
"errorType": "error-encrypted-private-rooms-enforced"
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}