Links

Channel Set Type

Sets the type of room this channel should be.
URL
Requires Auth
HTTP Method
/api/v1/channels.setType
yes
POST

Payload

Argument
Example
Required
Description
roomId
ByehQjC44FwMeiLbX
Required
The channel's id
roomName
chat-room-name
Required
The channel's name
type
c or p
Required
The type of room this channel should be, either c or p. c is for channel and p is for private.

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
-H "Content-type: application/json" \
https://localhost:3000/api/v1/channels.setType \
-d '{ "roomId": "ByehQjC44FwMeiLbX", "type": "p" }'
or
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
-H "Content-type: application/json" \
https://localhost:3000/api/v1/channels.setType \
-d '{ "roomName": "chat-room-name", "type": "p" }'

Example Result

{
"channel": {
"_id": "ByehQjC44FwMeiLbX",
"name": "testing0",
"t": "p",
"msgs": 0,
"u": {
"_id": "aiPqNoGkjpNDiRx6d",
"username": "goose160"
},
"ts": "2017-01-05T18:02:50.754Z",
"ro": false,
"sysMes": true,
"_updatedAt": "2017-01-05T19:02:24.429Z",
"usernames": [
"goose160",
"graywolf336"
],
"joinCodeRequired": true,
"muted": []
},
"success": true
}

Change Log

Version
Description
0.49.0
Added
Last modified 6mo ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.