> ## 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
> 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 |
## OpenAPI
````json POST /api/v1/groups.setType
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Rooms"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Channels"
},
{
"name": "Directory"
},
{
"name": "Groups"
},
{
"name": "Rooms"
},
{
"name": "Teams"
},
{
"name": "Room Invites"
},
{
"name": "Subscriptions"
},
{
"name": "ABAC"
}
],
"paths": {
"/api/v1/groups.setType": {
"post": {
"tags": [
"Groups"
],
"summary": "Set Group Type",
"description": "Set the room type. The group type can be either `c` (public) or `p` (private). Any of the following permissions are required:\n* `create-c`: This permission is required if you are changing a private channel to a public channel.\n* `create-p`: This permission is required if you are changing a public channel to a private room.\n* `create-team-channel`: This permission is required if you are changing a team's private channel to a public channel.\n* `create-team-group`: This permission is required if you are changing a team's public channel to a private room.\n\nFor ABAC-managed private rooms, changing the type from `p` to `c` is rejected with `error-action-not-allowed`.\nWhen 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.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.5.0 | Added ABAC behavior for `p` -> `c`: ABAC-managed private rooms are rejected, and successful conversions to public clear group ABAC attributes. |\n| 0.49.0 | Added |",
"operationId": "post-api-v1-groups.setType",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"roomId": {
"type": "string",
"description": "The group ID. You can find the IDs by using any of the following endpoints:\n* Get List of User Groups: This endpoint returns all private channels in the workspace, if you have the required permissions to view them.\n* Get Groups: This endpoint returns the private channels that you are a member of."
},
"type": {
"type": "string",
"description": "Enter the group type."
}
},
"required": [
"roomId",
"type"
]
},
"examples": {
"Example": {
"value": {
"roomId": "ByehQjC44FwMeiLbX",
"type": "c"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"group": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"name": {
"type": "string"
},
"t": {
"type": "string"
},
"msgs": {
"type": "integer"
},
"u": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"ts": {
"type": "string"
},
"ro": {
"type": "boolean"
},
"sysMes": {
"type": "boolean"
},
"_updatedAt": {
"type": "string"
},
"usernames": {
"type": "array",
"items": {
"type": "string"
}
},
"joinCodeRequired": {
"type": "boolean"
},
"muted": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
"success": {
"type": "boolean"
}
}
},
"examples": {
"Example": {
"value": {
"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
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
},
"details": {
"type": "object",
"properties": {
"method": {
"type": "string"
},
"action": {
"type": "string"
}
}
}
}
},
"examples": {
"Missing body param: type": {
"value": {
"success": false,
"error": "The bodyParam \"type\" is required"
}
},
"ABAC-managed room conversion blocked": {
"value": {
"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"
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/authorizationError"
}
}
}
}
},
"components": {
"parameters": {
"Auth-Token": {
"name": "X-Auth-Token",
"in": "header",
"description": "The `authToken` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
},
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The `userId` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
}
},
"responses": {
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"success": false,
"error": "You must be logged in to do this."
}
}
}
}
}
}
}
}
}
````