Add ABAC attribute key to room

Prev Next
Post
/api/v1/abac/rooms/:rid/attributes/:key
Defense
  • 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.
  • Members who do not hold the attribute are removed from the room as soon as the attribute is added, including the room owner and the administrator who made the call.
  • Default rooms and team default rooms can carry attributes. New users and team members are only added automatically to the attributed rooms they qualify for.
  • Requires the ABAC license, the abac-management and manage-abac-admin-rooms permissions, and the global setting ABAC_Enabled to be turned on.
  • The edit-room-abac-attributes room permission does not grant access to this endpoint. Room owners who hold only that permission receive a 403 error. They can change a room's attributes with POST /api/v1/abac/rooms/:rid/attributes.
  • Errors such as error-duplicate-attribute-key, error-room-not-found and error-invalid-attribute-values return only error, without errorType or details.

Changelog

Version Description
9.0.0 Federated rooms and discussions are refused with error-abac-federated-room-attributes and error-abac-discussion-room-attributes.
9.0.0 Default rooms can carry ABAC attributes. Removed the error-cannot-convert-default-room-to-abac error.
8.0.0 Added
8.5.0 Added the manage-abac-admin-rooms granular permission requirement.
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

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.
Example 1
{
  "values": [
    "asia"
  ]
}
object
values
Array of string
string
Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
400

Bad Request

ABAC not enabled
{
  "success": false,
  "error": "error-abac-not-enabled"
}
Attribute definition missing
{
  "success": false,
  "error": "error-attribute-definition-not-found"
}
Invalid attribute values
{
  "success": false,
  "error": "error-invalid-attribute-values"
}
Duplicate key on a room
{
  "success": false,
  "error": "error-duplicate-attribute-key"
}
Federated room
{
  "success": false,
  "error": "error-abac-federated-room-attributes",
  "errorType": "error-abac-federated-room-attributes"
}
Discussion
{
  "success": false,
  "error": "error-abac-discussion-room-attributes",
  "errorType": "error-abac-discussion-room-attributes"
}
Room not found
{
  "success": false,
  "error": "error-room-not-found"
}
object
success
boolean
error
string
errorType
string

Returned for ABAC error contract keys. Holds the same key as error.

401

Unauthorized

Unauthorized login attempt
{
  "success": false,
  "error": "error-unauthorized"
}
object
success
boolean
error
string
403

Forbidden

Missing required ABAC permissions
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
object
success
boolean
error
string