Role Controller

Update Role (Web3 Auth Required)

Path: /api/roles/{id}

Method: PUT

Example Http Request

PUT /api/roles/rol_789 HTTP/1.1
Content-Type: application/json
X-WAL: 0x1234567890123456789012345678901234567890
X-SIG: 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12
X-MES: VGVzdCBtZXNzYWdlIGZvciBhdXRoZW50aWNhdGlvbg==
Content-Length: 165
Host: localhost:8080

{
  "name" : "Updated Role",
  "description" : "Updated role description",
  "permissions" : null,
  "features" : [ "users.read", "users.update", "channels.read" ]
}

Example Http Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, Accept-Language, connection, Cache-Control, Access-Control-Request-Method, Access-Control-Request-Headers, X-SIG, X-WAL, X-MES
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD
Access-Control-Expose-Headers: Access-Control-Allow-Origin, Access-Control-Allow-Credentials
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 718

{
  "id" : "rol_789",
  "createdAt" : "2025-12-04T14:43:48.404Z",
  "updatedAt" : "2025-12-04T14:43:48.428Z",
  "version" : 1,
  "createdBy" : null,
  "updatedBy" : null,
  "tenantId" : "t_JHF3XMBK105SJ3VEK88VBR8EBC",
  "name" : "Updated Role",
  "description" : "Updated role description",
  "ownerAdminId" : "adm_123",
  "permissions" : [ {
    "resource" : "user",
    "action" : "read",
    "effect" : "ALLOW",
    "constraints" : { },
    "allow" : true,
    "deny" : false
  }, {
    "resource" : "channel",
    "action" : "read",
    "effect" : "ALLOW",
    "constraints" : { },
    "allow" : true,
    "deny" : false
  } ],
  "features" : [ "users.read", "users.update", "channels.read" ],
  "global" : false
}

Example Curl Request

$ curl 'http://localhost:8080/api/roles/rol_789' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'X-WAL: 0x1234567890123456789012345678901234567890' \
    -H 'X-SIG: 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12' \
    -H 'X-MES: VGVzdCBtZXNzYWdlIGZvciBhdXRoZW50aWNhdGlvbg==' \
    -d '{
  "name" : "Updated Role",
  "description" : "Updated role description",
  "permissions" : null,
  "features" : [ "users.read", "users.update", "channels.read" ]
}'

Role Controller