Custom roles
Update custom role
Update a single custom role. Updating a custom role uses a JSON patch or JSON merge patch representation of the desired changes. To learn more, read Updates.<br/><br/>To add an element to the policy array, set the path to /policy and then append /<array index>. Use /0 to add to the beginning of the array. Use /- to add to the end of the array.
patch/api/v2/roles/{customRoleKey}
Path parameters
customRoleKeystring string required
The custom role key
The custom role key
Request body
Example request
{
"patch": [
{
"op": "replace",
"path": "/exampleField",
"value": "new example value"
}
]
}Response
Custom role response
Example response
{
"_id": "1234a56b7c89d012345e678f",
"_access": {
"denied": [
{
"reason": {
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
}
],
"allowed": [
{
"reason": {
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
}
]
},
"description": "This custom role is just an example",
"key": "example-custom-role",
"name": "Example custom role",
"policy": [
{
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
],
"_presetStatements": [
{
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
]
}