Get all user roles

GET /roles

Get all available user roles with their IDs and descriptions

Responses

  • 200 application/json

    Roles retrieved successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attribute Show data attribute object
      • roles array[object]
        Hide roles attributes Show roles attributes object
        • id string

          Role ID

        • name string

          Role name

        • description string

          Role description

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
GET /roles
curl \
 --request GET 'https://api.your-domain.com/api/roles' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "code": 200,
  "message": "roles retrieved successfully",
  "data": {
    "roles": [
      {
        "id": "rol_admin_123",
        "name": "Admin",
        "description": "Full system administration capabilities"
      }
    ]
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}