---
title: "Add ABAC attribute key to room"
slug: "add-abac-attribute-key-to-room"
updated: 2026-06-01T06:32:04Z
published: 2026-06-01T06:32:04Z
---

> ## 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 ABAC attribute key to room

Post/api/v1/abac/rooms/:rid/attributes/:key![Defense](https://raw.githubusercontent.com/RocketChat/Rocket.Chat-Open-API/main/images/Defense.svg)

- Adds a single ABAC attribute key to a room.
- Creates a new ABAC attribute on the specified room for the given key, assigning it the provided values array; fails if the room already has this key or if the key/values are not allowed by the global attribute definition.
- 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. |

Header parametersX-Auth-TokenstringRequired

The `authToken` of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-IdstringRequired

The `userId` of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ

Body parameters

- Values (array of strings, required): The attribute values to assign for this key.
- Must have at least 1 item, max 10 items, and all values must be unique.

<select class='api-response-data' aria-label='Media type'><option value='e43fe846-d5d4-41bb-a369-a9cbe562bdc4'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='a83ab297-884c-499d-87ee-4f0004717727'>Example 1</option>
</select>Example 1

```json
{
  "values": [
    "asia"
  ]
}
```

object  values Array of string   string    

Responses200

OK

<select class='api-response-data' aria-label='Media type'><option value='a36d8e5c-2884-4f84-9810-8101813793e6'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='86f20c4f-8b03-4e9d-a5c5-7b785f5759f2'>Success</option>
</select>Success

```json
{
  "success": true
}
```

object  successboolean    

400

Bad Request

<select class='api-response-data' aria-label='Media type'><option value='de78badd-108f-4764-8b62-66cfc536c54d'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='a66cdf32-0458-4589-bea9-e3aab76a0151'>ABAC not enabled</option>
<option value='4c3c272a-0b1e-4f94-8b25-e8b830978298'>Attribute definition missing</option>
<option value='f9b6e173-1498-4d7a-b6a5-cfda8084c85f'>Invalid attribute values</option>
<option value='cc790370-c48b-45b0-bfb4-e3e3271393d3'>Duplicate key on a room</option>
<option value='797817e9-a932-48d3-9389-5a592f0620d9'>Cannot convert default room to ABAC</option>
<option value='f7500277-f4cd-449d-b4f4-c42eaed77c03'>Room not found</option>
</select>ABAC not enabled

```json
{
  "success": false,
  "error": "error-abac-not-enabled"
}
```

Attribute definition missing

```json
{
  "success": false,
  "error": "error-attribute-definition-not-found"
}
```

Invalid attribute values

```json
{
  "success": false,
  "error": "error-invalid-attribute-values"
}
```

Duplicate key on a room

```json
{
  "success": false,
  "error": "error-duplicate-attribute-key"
}
```

Cannot convert default room to ABAC

```json
{
  "success": false,
  "error": "error-cannot-convert-default-room-to-abac"
}
```

Room not found

```json
{
  "success": false,
  "error": "error-room-not-found"
}
```

object  successboolean    
errorstring    

401

Unauthorized

<select class='api-response-data' aria-label='Media type'><option value='2da82d60-1215-4569-88ac-4d6dd34a7e25'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='91c22248-7ae2-497c-b8bc-04a0af042f58'>Unauthorized login attempt</option>
</select>Unauthorized login attempt

```json
{
  "success": false,
  "error": "error-unauthorized"
}
```

object  successboolean    
errorstring    

403

Forbidden

<select class='api-response-data' aria-label='Media type'><option value='cb02b8df-3dcd-4174-80c7-96d5a1774302'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='b5936f91-c522-45ed-be11-83db5b715aed'>Missing required ABAC permissions</option>
</select>Missing required ABAC permissions

```json
{
  "success": false,
  "error": "error-not-authorized"
}
```

object  successboolean    
errorstring
