Creates a new discussion for the room. It requires at least one of the following permissions: start-discussion OR start-discussion-other-user, AND must be with the following setting enabled: Discussion_enabled.
When Force end-to-end encryption on private rooms is enabled, you cannot create a discussion under an unencrypted private room. Make the parent room public or enable encryption on it before creating the discussion.
Changelog
| Version | Description |
|---|---|
| 8.8.0 | Added forced encryption checks for private-room discussions. |
| 1.0.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
{
"prid": "GENERAL",
"t_name": "Discussion Name"
}Parent room ID of the discussion.
Discussion name.
Array of users to join in the discussion, if not provided, it will be an empty array. (Note: if provided, it must be an array).
Parent message ID (if the discussion comes from a message).
The reply of the discussion.
OK
{
"discussion": {
"rid": "cgk88DHLHexwMaFWh",
"name": "WJNEAM7W45wRYitHo",
"fname": "Discussion Name",
"t": "p",
"msgs": 0,
"usersCount": 0,
"u": {
"_id": "rocketchat.internal.admin.test",
"username": "rocketchat.internal.admin.test"
},
"topic": "general",
"prid": "GENERAL",
"ts": "2019-04-03T01:35:32.271Z",
"ro": false,
"sysMes": true,
"default": false,
"_updatedAt": "2019-04-03T01:35:32.280Z",
"_id": "cgk88DHLHexwMaFWh"
},
"success": true
}Bad Request
{
"success": false,
"error": "Workspace policy requires all private rooms to be encrypted. To create this discussion, make the parent channel public or enable encryption on it. [error-encrypted-private-rooms-enforced-discussion]",
"errorType": "error-encrypted-private-rooms-enforced-discussion"
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}