---
updatedAt: 2026-10-06T17:37:25.000Z
agentTools:
  projectIndex: https://docs.akeyless.io/llms.txt
---

# /list-roles

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "email": "support@akeyless.io",
      "name": "Akeyless",
      "url": "http://akeyless.io"
    },
    "description": "The purpose of this application is to provide access to Akeyless API.",
    "title": "Identity & access",
    "version": "3.0"
  },
  "paths": {
    "/list-roles": {
      "post": {
        "operationId": "listRoles",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/listRoles"
              }
            }
          },
          "required": true,
          "x-go-name": "Body"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/listRolesResponse"
          },
          "default": {
            "$ref": "#/components/responses/errorResponse"
          }
        },
        "tags": [
          "Access Roles"
        ],
        "x-docs-category": "Identity & access",
        "x-docs-group": "Access Roles"
      }
    }
  },
  "tags": [
    {
      "name": "Access Roles"
    }
  ],
  "x-readme": {
    "apply-tag-changes": true
  },
  "servers": [
    {
      "url": "https://api.akeyless.io"
    }
  ],
  "components": {
    "responses": {
      "errorResponse": {
        "description": "errorResponse wraps any error to return it as a JSON object with one \"error\"\nfield.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JSONError"
            }
          }
        }
      },
      "listRolesResponse": {
        "description": "listRolesResponse wraps response body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListRolesOutput"
            }
          }
        }
      }
    },
    "schemas": {
      "JSONError": {
        "properties": {
          "error": {
            "type": "string",
            "x-go-name": "Err"
          }
        },
        "title": "JSONError wraps an error with JSON object.",
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/client"
      },
      "ListRolesOutput": {
        "properties": {
          "next_page": {
            "type": "string",
            "x-go-name": "NextPage"
          },
          "roles": {
            "items": {
              "$ref": "#/components/schemas/Role"
            },
            "type": "array",
            "x-go-name": "Roles"
          }
        },
        "title": "ListRolesOutput is a list of roles.",
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/infra/types"
      },
      "PathRule": {
        "properties": {
          "assigners": {
            "items": {
              "$ref": "#/components/schemas/RuleAssigner"
            },
            "type": "array",
            "x-go-name": "Assigners"
          },
          "capabilities": {
            "description": "The approved/denied capabilities in the path",
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "Capabilities"
          },
          "cb": {
            "format": "uint64",
            "type": "integer",
            "x-go-name": "CapabilitiesBitmap"
          },
          "is_limit_access": {
            "description": "flag that indicate that this rule is allowed to be access RemainingAccess of times.",
            "type": "boolean",
            "x-go-name": "IsLimitAccess"
          },
          "item_id": {
            "description": "The item id this rule directly refers to (when applicable)",
            "format": "int64",
            "type": "integer",
            "x-go-name": "ItemID"
          },
          "number_of_access_used": {
            "format": "int64",
            "type": "integer",
            "x-go-name": "NumberOfAccessUsed"
          },
          "number_of_allowed_access": {
            "format": "int64",
            "type": "integer",
            "x-go-name": "NumberOfAllowedAccess"
          },
          "path": {
            "description": "The path the rule refers to",
            "type": "string",
            "x-go-name": "Path"
          },
          "start_time": {
            "format": "int64",
            "type": "integer",
            "x-go-name": "StartTime"
          },
          "ttl": {
            "format": "int64",
            "type": "integer",
            "x-go-name": "TTL"
          },
          "type": {
            "$ref": "#/components/schemas/PathRuleType"
          }
        },
        "title": "PathRule is a single rule used in AKEYLESS RBAC.",
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/infra/types"
      },
      "PathRuleType": {
        "title": "PathRuleType defines a kind of every PathRule assigned to a Role.",
        "type": "string",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/infra/types"
      },
      "Role": {
        "properties": {
          "access_date": {
            "format": "date-time",
            "type": "string",
            "x-go-name": "AccessDate"
          },
          "access_date_display": {
            "type": "string",
            "x-go-name": "AccessDateDisplay"
          },
          "client_permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "x-go-name": "ClientPermissions"
          },
          "comment": {
            "type": "string",
            "x-go-name": "Comment"
          },
          "creation_date": {
            "format": "date-time",
            "type": "string",
            "x-go-name": "CreationDate"
          },
          "delete_protection": {
            "type": "boolean",
            "x-go-name": "DeleteProtection"
          },
          "modification_date": {
            "format": "date-time",
            "type": "string",
            "x-go-name": "ModificationDate"
          },
          "role_auth_methods_assoc": {
            "items": {
              "$ref": "#/components/schemas/RoleAuthMethodAssociation"
            },
            "type": "array",
            "x-go-name": "RoleAuthMethodsAssoc"
          },
          "role_id": {
            "format": "int64",
            "type": "integer",
            "x-go-name": "RoleId"
          },
          "role_name": {
            "type": "string",
            "x-go-name": "RoleName"
          },
          "rules": {
            "$ref": "#/components/schemas/Rules"
          }
        },
        "title": "Role includes role details.",
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/infra/types"
      },
      "RoleAuthMethodAssociation": {
        "description": "RoleAuthMethodAssociation includes details of an association between a role\nand an auth method.",
        "properties": {
          "assoc_id": {
            "type": "string",
            "x-go-name": "AssociationID"
          },
          "auth_method_access_id": {
            "type": "string",
            "x-go-name": "AuthMethodAccessID"
          },
          "auth_method_id": {
            "format": "int64",
            "type": "integer",
            "x-go-name": "AuthMethodId"
          },
          "auth_method_name": {
            "type": "string",
            "x-go-name": "AuthMethodName"
          },
          "auth_method_sub_claims": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "x-go-name": "AuthMethodSubClaims"
          },
          "is_subclaims_with_operator": {
            "type": "boolean",
            "x-go-name": "IsSubclaimsWithOperator"
          },
          "sub_claims_case_sensitive": {
            "type": "boolean",
            "x-go-name": "IsSubClaimsCaseSensitive"
          }
        },
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/infra/types"
      },
      "RuleAssigner": {
        "properties": {
          "access_id": {
            "type": "string",
            "x-go-name": "AccessId"
          },
          "unique_id": {
            "type": "string",
            "x-go-name": "UniqueId"
          }
        },
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/infra/types"
      },
      "Rules": {
        "properties": {
          "admin": {
            "description": "Is admin",
            "type": "boolean",
            "x-go-name": "Admin"
          },
          "path_rules": {
            "description": "The path the rules refers to",
            "items": {
              "$ref": "#/components/schemas/PathRule"
            },
            "type": "array",
            "x-go-name": "PathRules"
          }
        },
        "title": "Rules are a part of AKEYLESS RBAC.",
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/infra/types"
      },
      "listRoles": {
        "properties": {
          "filter": {
            "description": "Filter by item name or part of it",
            "type": "string",
            "x-go-name": "Filter"
          },
          "json": {
            "default": false,
            "description": "Set output format to JSON",
            "type": "boolean",
            "x-go-name": "Json"
          },
          "pagination-token": {
            "description": "Next page reference",
            "type": "string",
            "x-go-name": "PaginationToken"
          },
          "token": {
            "description": "Authentication token (see `/auth` and `/configure`)",
            "type": "string",
            "x-go-name": "Profile"
          },
          "uid-token": {
            "description": "The universal identity token, Required only for universal_identity authentication",
            "type": "string",
            "x-go-name": "UIDToken"
          }
        },
        "title": "listRoles is a command that returns a list of roles.",
        "type": "object",
        "x-go-package": "akeyless.io/akeyless-main-repo/go/src/client/commands"
      }
    }
  }
}
```