Skip to main content
PATCH
/
v1
/
roles
/
{roleId}
Update a custom role
curl --request PATCH \
  --url http://localhost:3333/v1/roles/{roleId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Compliance Manager",
  "permissions": {
    "control": [
      "read",
      "update",
      "delete"
    ],
    "policy": [
      "read",
      "update",
      "publish",
      "approve"
    ],
    "risk": [
      "read",
      "assess"
    ]
  }
}
'
{
  "id": "<string>",
  "name": "<string>",
  "permissions": {},
  "isBuiltIn": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

roleId
string
required

Role ID

Example:

"rol_abc123"

Body

application/json
name
string

New name for the custom role

Required string length: 2 - 50
Example:

"Compliance Manager"

permissions
object

Updated permissions for the role. Keys are resource names, values are arrays of allowed actions.

Example:
{
"control": ["read", "update", "delete"],
"policy": ["read", "update", "publish", "approve"],
"risk": ["read", "assess"]
}

Response

Role updated successfully

id
string
name
string
permissions
object
isBuiltIn
boolean
createdAt
string<date-time>
updatedAt
string<date-time>