Custom roles

Update custom role

PATCH
/api/v2/roles/{customRoleKey}

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.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.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Path Parameters

customRoleKey*string

The custom role key

Formatstring

Request Body

application/json

patch*array<>

A JSON patch representation of the change to make

comment?string

Optional comment

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v2/roles/string" \  -H "Content-Type: application/json" \  -d '{    "patch": [      {        "op": "add",        "path": "/policy/0",        "value": {          "actions": [            "updateOn"          ],          "effect": "allow",          "resources": [            "proj/*:env/qa:flag/*"          ]        }      }    ]  }'
{  "_id": "1234a56b7c89d012345e678f",  "_links": {    "property1": {      "href": "string",      "type": "string"    },    "property2": {      "href": "string",      "type": "string"    }  },  "_access": {    "denied": [      {        "action": "string",        "reason": {          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "notResources": [            "string"          ],          "actions": [            "*"          ],          "notActions": [            "string"          ],          "effect": "allow",          "role_name": "string"        }      }    ],    "allowed": [      {        "action": "string",        "reason": {          "resources": [            "proj/*:env/*;qa_*:/flag/*"          ],          "notResources": [            "string"          ],          "actions": [            "*"          ],          "notActions": [            "string"          ],          "effect": "allow",          "role_name": "string"        }      }    ]  },  "description": "This custom role is just an example",  "key": "example-custom-role",  "name": "Example custom role",  "policy": [    {      "resources": [        "proj/*:env/*;qa_*:/flag/*"      ],      "notResources": [        "string"      ],      "actions": [        "*"      ],      "notActions": [        "string"      ],      "effect": "allow"    }  ],  "basePermissions": "reader",  "resourceCategory": "string",  "assignedTo": {    "membersCount": 0,    "teamsCount": 0  },  "_presetBundleVersion": 0,  "_presetStatements": [    {      "resources": [        "proj/*:env/*;qa_*:/flag/*"      ],      "notResources": [        "string"      ],      "actions": [        "*"      ],      "notActions": [        "string"      ],      "effect": "allow"    }  ]}