Skip to main content

Update a role

PUT <your-unleash-url>/api/admin/roles/:roleId

Authorization

name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API

Update a custom role by role id

Request

Path Parameters

  • roleId string required

Body

required

createRoleWithPermissionsSchema

    anyOf
  • name string required

    The name of the custom role

  • description string

    A more detailed description of the custom role and what use it's intended for

  • type string

    Possible values: [root-custom, custom]

    Custom root roles (type=root-custom) are root roles with a custom set of permissions. Custom project roles (type=custom) contain a specific set of permissions for project resources.

  • permissions object[]

    A list of permissions assigned to this role

  • Array [
  • name string required

    The name of the permission

  • environment string

    The environments of the permission if the permission is environment specific

  • ]
Responses

roleWithVersionSchema

Schema
  • version integer required

    Possible values: >= 1

    The version of this schema

  • roles objectrequired

    A role holds permissions to allow Unleash to decide what actions a role holder is allowed to perform

  • id integer required

    The role id

  • type string required

    A role can either be a global root role (applies to all projects) or a project role

  • name string required

    The name of the role

  • description string

    A more detailed description of the role and what use it's intended for

  • project string nullable

    What project the role belongs to

Authorization

name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API

Request

Base URL
<your-unleash-url>
Security Scheme
apiKey
roleId — path required
Body required
{
"name": "external-contributors",
"description": "Users with external-contributors role have limited access to most features in Unleash",
"type": "root-custom",
"permissions": [
{
"name": "CREATE_PROJECT",
"environment": "development"
}
]
}
curl / cURL
curl -L -X PUT '<your-unleash-url>/api/admin/roles/:roleId' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"name": "external-contributors",
"description": "Users with external-contributors role have limited access to most features in Unleash",
"type": "root-custom",
"permissions": [
{
"name": "CREATE_PROJECT",
"environment": "development"
}
]
}'