Set the channel type. The channel type can be either c (public) or p (private). The following permissions are required:
create-c: To change a private group to a public channel.create-p: To change a public channel to a private room.
For ABAC-managed private rooms, changing the type from p to c is rejected with error-action-not-allowed.
When the type changes to c (public) and the room has ABAC attributes, all ABAC attributes on the room are cleared as part of the conversion.
Changelog
| Version | Description |
|---|---|
| 8.5.0 | Added ABAC behavior for p -> c: ABAC-managed private rooms are rejected, and successful conversions to public clear room ABAC attributes. |
| 0.49.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
{
"roomId": "WDuJLFkjwk6L7LdFC",
"type": "p"
}The channel's ID. Alternatively, enter the channelName parameter and provide the channel's name as the value.
The channel's type. The type of room this channel should be, either c or p.
c is for channel and p is for private.
OK
{
"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
}Bad Request
{
"success": false,
"error": "Changing an ABAC managed private room to public is not allowed [error-action-not-allowed]",
"errorType": "error-action-not-allowed",
"details": {
"method": "saveRoomSettings",
"action": "Change_Room_Type"
}
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}