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 requiredThe role id 
- type string requiredA role can either be a global rootrole, or aprojectrole or acustomproject role or a custom globalroot-customrole
- name string requiredThe name of the role 
- description stringA 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 required- The identifier for this permission name string required- The name of this permission displayName string required- The name to display in listings of permissions type string required- What level this permission applies to. Either root, project or the name of the environment it applies to environment string- Which 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 toggles",
      "type": "project",
      "environment": "development"
    }
  ]
}
The request data does not match what we expect.
- application/json
- Schema
- Example (from schema)
Schema
- id stringThe ID of the error instance 
- name stringThe name of the error kind 
- message stringA 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 stringThe ID of the error instance 
- name stringThe name of the error kind 
- message stringA 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 stringThe ID of the error instance 
- name stringThe name of the error kind 
- message stringA description of what went wrong. 
{
  "id": "9c40958a-daac-400e-98fb-3bb438567008",
  "name": "NotFoundError",
  "message": "Could not find the addon with ID \"12345\"."
}