Get a single role
GET /api/admin/roles/:roleId
Get a single role by role id
Request
Path Parameters
- roleId string required
- 200
- 400
- 401
- 404
roleWithPermissionsSchema
- application/json
- Schema
- Example (from schema)
Schema
- id number required
The role id
- type string required
A role can either be a global
root
role, or aproject
role or acustom
project role or a custom globalroot-custom
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
permissions object[]required
A list of permissions assigned to this role
Array [id integer requiredThe identifier for this permission
name string requiredThe name of this permission
displayName string requiredThe name to display in listings of permissions
type string requiredWhat level this permission applies to. Either root, project or the name of the environment it applies to
environment stringWhich environment this permission applies to
]
{
"id": 9,
"type": "root",
"name": "Editor",
"description": "Users with the editor role have access to most features in Unleash but can not manage users and roles in the global scope. Editors will be added as project owners when creating projects and get superuser rights within the context of these projects. Users with the editor role will also get access to most permissions on the default project by default.",
"permissions": [
{
"id": 3,
"name": "UPDATE_FEATURE",
"displayName": "Update feature flags",
"type": "project",
"environment": "development"
}
]
}
The request data does not match what we expect.
- application/json
- Schema
- Example (from schema)
Schema
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "ValidationError",
"message": "The request payload you provided doesn't conform to the schema. The .parameters property should be object. You sent []."
}
Authorization information is missing or invalid. Provide a valid API token as the authorization
header, e.g. authorization:*.*.my-admin-token
.
- application/json
- Schema
- Example (from schema)
Schema
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "AuthenticationRequired",
"message": "You must log in to use Unleash. Your request had no authorization header, so we could not authorize you. Try logging in at /auth/simple/login."
}
The requested resource was not found.
- application/json
- Schema
- Example (from schema)
Schema
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "NotFoundError",
"message": "Could not find the addon with ID \"12345\"."
}