R B A C Configuratorv1
Assign Roles to Endpoint
Assigns one or more roles to a specific API endpoint. Existing assignments are preserved (additive). **Important:** This operation is atomic - if ANY role fails to assign (e.g., role not found), the ENTIRE operation is rejected and NO roles are assigned. This prevents partial/inconsistent permission states.
POST
/v1/rbac/endpoint-role/assignAuthorization
BearerAuth AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/rbac/endpoint-role/assign" \ -H "Content-Type: application/json" \ -d '{ "endpoint": "/v1/customers", "method": "GET", "roles": [ "User", "StandardUser" ] }'{
"message": "Roles assigned successfully",
"endpoint": "/v1/customers",
"method": "GET",
"roles": [
"User",
"StandardUser"
]
}{
"error": "Failed to assign roles to endpoint: InvalidRole, NonExistentRole (assigned 0/3)",
"code": "400",
"params": {
"failed_roles": "InvalidRole, NonExistentRole",
"success_count": 0,
"total_count": 3
}
}Empty
{
"error": "Cannot assign non-Administrator roles to protected endpoint /v1/rbac/endpoint-role/assign. This endpoint controls the permission system and must remain Administrator-only.",
"code": "403"
}{
"error": "Endpoint GET /v1/nonexistent not found",
"code": "404",
"params": {
"endpoint": "/v1/nonexistent",
"method": "GET"
}
}Empty