Skip to main content
GET
Get All Roles

List Roles

Retrieve all available user roles in the SecureAI system.

Endpoint

Description

This endpoint returns all user roles available in the SecureAI system. It provides detailed information about each role including permissions, descriptions, and metadata. This is useful for understanding the available roles and their capabilities.

Authentication

Required: API Key with admin privileges

Query Parameters

Example Request

Success Response

Status Code: 200 OK

Response Fields

Example Usage

JavaScript

Python

cURL

Error Responses

401 Unauthorized

403 Forbidden

429 Too Many Requests

Use Cases

  • Role Management: List all available roles for user assignment
  • Permission Review: Understand what permissions each role has
  • Access Control: Plan user access based on available roles
  • User Assignment: Assign roles to users based on their needs
  • Role Analysis: Analyze role usage and user distribution

Rate Limits

  • Default: 100 requests per minute
  • Daily: 10,000 requests per day
  • Monthly: 300,000 requests per month

Notes

  • This endpoint requires admin privileges
  • Page-based Pagination: Uses page parameter, not offset
  • Search: Searches in name, displayName, and description fields
  • System Roles: Can filter by system vs custom roles
  • Sorting: Can sort by any field in ascending or descending order
  • Flat Response: Response is not nested under data object
  • User Count: Shows how many users have each role
  • Creator Info: Shows who created each role

Autorizações

Authorization
string
header
obrigatório

API key authentication using Bearer token format. Example: Authorization: Bearer sk-your-api-key-here

Parâmetros de consulta

page
integer
padrão:1

Page number for pagination

Intervalo necessário: x >= 1
limit
integer
padrão:20

Number of roles per page

Intervalo necessário: 1 <= x <= 100

Search term for role name, display name, or description

isSystem
enum<string>

Filter by system roles

Opções disponíveis:
true,
false
sortBy
string
padrão:createdAt

Field to sort by

sortOrder
enum<string>
padrão:desc

Sort order

Opções disponíveis:
asc,
desc

Resposta

List of roles

success
boolean
Exemplo:

true

roles
object[]
pagination
object