---
updatedAt: 2026-05-12T10:00:08.000Z
---

# Retrieve all role collections

This operation returns an object containing information about all roles visible to the current user.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Role API (Legacy)",
    "license": {
      "name": "(c) Copyright 2020 WhiteHat Security"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sentinel.whitehatsec.com"
    }
  ],
  "paths": {
    "/api/role": {
      "get": {
        "tags": [
          "Role API v1.0"
        ],
        "summary": "Retrieve all role collections",
        "description": "This operation returns an object containing information about all roles visible to the current user.",
        "operationId": "getAllRoles",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "description": "Format of results.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string",
              "default": "xml",
              "example": "json",
              "enum": [
                "json",
                "xml",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Provides the information about all roles visible to the current requester.",
            "headers": {},
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRoles"
                }
              },
              "application/xml": {
                "example": "XML preview is currently not supported."
              },
              "text/csv, text/comma-separated-values": {
                "schema": {
                  "type": "string",
                  "description": "Column headers for data that may be returned using this format.",
                  "example": "id,client_id,description,href,name"
                }
              }
            }
          },
          "400": {
            "description": "BadRequestResponse indicates a request with invalid parameters.",
            "content": {}
          },
          "401": {
            "description": "UnauthorizedResponse signals an unauthorized API access.",
            "content": {}
          },
          "403": {
            "description": "ForbiddenResponse signals a request for a resource that does not exist or is not authorized.",
            "content": {}
          },
          "500": {
            "description": "GenericError generic error.",
            "content": {}
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UserRole": {
        "properties": {
          "description": {
            "type": "string"
          },
          "privileges": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "href": {
            "type": "string"
          },
          "client_id": {
            "type": "number"
          }
        }
      },
      "UserRoles": {
        "properties": {
          "collection": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserRole"
            }
          },
          "type": {
            "type": "string"
          },
          "href": {
            "type": "string"
          },
          "page": {
            "properties": {
              "total": {
                "type": "number"
              }
            },
            "type": "object"
          }
        }
      }
    }
  },
  "x-explorer-enabled": false,
  "x-readme": {
    "proxy-enabled": true
  }
}
```