Create Discussion

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.

HTTP MethodURLRequires Auth

POST

/api/v1/rooms.createDiscussion

Body Parameters

KeyExample ValueDescription

prid*

GENERAL

Parent room ID of the discussion.

t_name*

discussion name

Discussion name.

users

['rocket.cat']

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).

pmid

aobEgbghXfe543keqG

Parent message ID (if the discussion comes from a message).

reply

reply of this discussion

The reply of the discussion.

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -H "Content-Type: application/json" \
     http://localhost:3000/api/v1/rooms.createDiscussion  \
     -d '{ 
          "prid": "GENERAL", 
          "t_name": "Discussion Name"}'

Example Response

{
    "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
}

Change Log

VersionDescription

1.0.0

Added

Last updated

Rocket.Chat versions receive support for six months after release.