> ## 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.
# Replace room ABAC attributes
>
- Replaces the full ABAC attribute set for a room.
- Sets the complete set of ABAC attributes on the specified room by providing an attributes object that maps attribute keys to arrays of allowed values; any previously assigned attributes not included in the request are removed.
- Requires the ABAC license, the `abac-management` and `manage-abac-admin-rooms` permissions, and the global setting `ABAC_Enabled` to be turned on.
### Changelog
| Version | Description |
| ------- | ----------- |
| 8.0.0 | Added |
| 8.5.0 | Added the `manage-abac-admin-rooms` granular permission requirement. |
## OpenAPI
````json POST /api/v1/abac/rooms/:rid/attributes
{
"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/abac/rooms/:rid/attributes": {
"parameters": [],
"post": {
"summary": "Replace room ABAC attributes",
"tags": [
"ABAC"
],
"responses": {
"200": {
"$ref": "#/components/responses/trueSuccess"
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"ABAC not enabled": {
"value": {
"success": false,
"error": "error-abac-not-enabled"
}
},
"Attribute definition missing": {
"value": {
"success": false,
"error": "error-attribute-definition-not-found"
}
},
"Invalid attribute values": {
"value": {
"success": false,
"error": "error-invalid-attribute-values"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/authorizationError"
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Missing required ABAC permissions": {
"value": {
"success": false,
"error": "error-not-authorized"
}
}
}
}
}
}
},
"operationId": "post-abac-rooms-rid-attributes",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
}
],
"description": "\n\n- Replaces the full ABAC attribute set for a room.\n- Sets the complete set of ABAC attributes on the specified room by providing an attributes object that maps attribute keys to arrays of allowed values; any previously assigned attributes not included in the request are removed.\n- Requires the ABAC license, the `abac-management` and `manage-abac-admin-rooms` permissions, and the global setting `ABAC_Enabled` to be turned on.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.0.0 | Added |\n| 8.5.0 | Added the `manage-abac-admin-rooms` granular permission requirement. |",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object"
},
"examples": {
"Example 1": {
"value": {
"attributes": {
"department": [
"it",
"sales"
],
"region": [
"asia",
"europa"
]
}
}
}
}
}
}
}
}
}
},
"components": {
"responses": {
"trueSuccess": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success": {
"value": {
"success": true
}
}
}
}
}
},
"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."
}
}
}
}
}
}
},
"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"
}
}
}
}
````