v5

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-02-283466592.5 MB
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

commentstring

Optional comment

Example request

{
  "patch": [
    {
      "op": "replace",
      "path": "/exampleField",
      "value": "new example value"
    }
  ]
}

Response

Custom role response

_idstring required

The ID of the custom role

_linksobject required

The location and content type of related resources

descriptionstring

The description of the custom role

keystring required

The key of the custom role

namestring required

The name of the custom role

basePermissionsstring
resourceCategorystring
_presetBundleVersioninteger

If created from a preset, the preset bundle version

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"
    }
  ]
}