Documentation Index

Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt

Use this file to discover all available pages before exploring further.

Set Group Type

Prev Next
Post
/api/v1/groups.setType

Set the room type. The group type can be either c (public) or p (private). Any of the following permissions are required:

  • create-c: This permission is required if you are changing a private channel to a public channel.
  • create-p: This permission is required if you are changing a public channel to a private room.
  • create-team-channel: This permission is required if you are changing a team's private channel to a public channel.
  • create-team-group: This permission is required if you are changing a team's 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 group has ABAC attributes, all ABAC attributes on the group 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 group ABAC attributes.
0.49.0 Added
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example
{
  "roomId": "ByehQjC44FwMeiLbX",
  "type": "c"
}
object
roomId
string Required

The group ID. You can find the IDs by using any of the following endpoints:

  • Get List of User Groups: This endpoint returns all private channels in the workspace, if you have the required permissions to view them.
  • Get Groups: This endpoint returns the private channels that you are a member of.
type
string Required

Enter the group type.

Responses
200

OK

Example
{
  "group": {
    "_id": "ByehQjC44FwMeiLbX",
    "name": "testing0",
    "t": "c",
    "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
}
Expand All
object
group
object
_id
string
name
string
t
string
msgs
integer
u
object
_id
string
username
string
ts
string
ro
boolean
sysMes
boolean
_updatedAt
string
usernames
Array of string
string
joinCodeRequired
boolean
muted
Array of object
object
success
boolean
400

Bad Request

Missing body param: type
{
  "success": false,
  "error": "The bodyParam \"type\" is required"
}
ABAC-managed room conversion blocked
{
  "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"
  }
}
Expand All
object
success
boolean
error
string
errorType
string
details
object
method
string
action
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string