---
title: "Create ABAC attribute definition"
slug: "create-abac-attribute-definition"
updated: 2026-06-08T12:46:40Z
published: 2026-06-08T12:46:40Z
---

> ## 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.

# Create ABAC attribute definition

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

- Creates a new ABAC attribute definition.
- Registers a global ABAC attribute by specifying its key and the list of allowed values, making it available for use on rooms and users.
- Requires the ABAC license, the `abac-management` and `manage-abac-admin-room-attributes` 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-room-attributes` 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<select class='api-response-data' aria-label='Media type'><option value='7020e798-5d00-45da-bf34-e2c6b24ce11a'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='a04f0cce-cda8-4d36-85c4-5c5f901332df'>Example 1</option>
</select>Example 1

```json
{
  "key": "my_department",
  "values": [
    "eng",
    "sales",
    "hr",
    "it"
  ]
}
```

object  keystring    
values Array of string   string    

Responses200

OK

<select class='api-response-data' aria-label='Media type'><option value='78199dbb-d10e-4a2a-99da-69143e8e9469'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='5a9aa742-a524-45a8-9704-715b68b40168'>Success</option>
</select>Success

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

object  successboolean    

400

Bad Request

<select class='api-response-data' aria-label='Media type'><option value='fc14386c-ba89-4b63-9b2e-78fb3c9c2e61'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='3cf00eee-e540-417f-8657-8fcb9c444764'>ABAC disabled</option>
<option value='9b664783-21b3-4c13-814b-756dff776f4d'>Invalid attribute values</option>
<option value='0957e65b-eea1-48e6-9971-2dba7c53414c'>Invalid attribute key</option>
<option value='2f648a85-4d5a-48b6-9521-ecb5b70a431f'>Duplicate attribute key</option>
</select>ABAC disabled

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

Invalid attribute values

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

Invalid attribute key

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

Duplicate attribute key

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

object  successboolean    
errorstring    

401

Unauthorized

<select class='api-response-data' aria-label='Media type'><option value='9ac333bb-c80f-4c47-a2de-ba95e18b35d5'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='19a0f0cd-ca74-4484-b7da-e3597a8eb6aa'>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='6f2ad3ae-f7fe-460e-9e0f-7a6c5a5adc23'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='c8c97c2e-8da9-45da-92b5-7c0ad5aca756'>Missing required ABAC permissions</option>
</select>Missing required ABAC permissions

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

object  successboolean    
errorstring
