> ## 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.
# Add All Users to Group
> Add all workspace users to the private channel. You can do this if you are a member of the private channel or have admin permissions.
### Changelog
| Version | Description |
| ------- | ----------- |
| 0.55.0 | Added |
## OpenAPI
````json POST /api/v1/groups.addAll
{
"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.addAll": {
"post": {
"tags": [
"Groups"
],
"summary": "Add All Users to Group",
"description": "Add all workspace users to the private channel. You can do this if you are a member of the private channel or have admin permissions.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 0.55.0 | Added |",
"operationId": "post-api-v1-groups.addAll",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"roomId": {
"type": "string",
"description": "Enter the group ID. Alternatively, you can enter the name using the `roomName` query parameter. 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."
},
"activeUsersOnly": {
"type": "boolean",
"description": "Add only active users to the room."
}
},
"required": [
"roomId"
]
},
"examples": {
"Example": {
"value": {
"roomId": "ByehQjC44FwMeiLbX",
"activeUsersOnly": "true"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"channel": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"name": {
"type": "string"
},
"t": {
"type": "string"
},
"usernames": {
"type": "array",
"items": {
"type": "string"
}
},
"msgs": {
"type": "integer"
},
"u": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"ts": {
"type": "string"
}
}
},
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success": {
"value": {
"channel": {
"_id": "ByehQjC44FwMeiLbX",
"name": "groupname",
"t": "p",
"usernames": [
"example",
"rocket.cat"
],
"msgs": 0,
"u": {
"_id": "aobEdbYhXfu5hkeqG",
"username": "example"
},
"ts": "2016-05-30T13:42:25.304Z"
},
"success": true
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
}
}
},
"examples": {
"Example 1": {
"value": {
"success": false,
"error": "The required \"roomId\" or \"roomName\" param provided does not match any group [error-room-not-found]",
"errorType": "error-room-not-found"
}
}
}
}
}
},
"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."
}
}
}
}
}
}
}
}
}
````