Skip to main content

GET /api/roles/

Retrieves detailed information about a specific role, including all assigned permissions.

Authentication

This endpoint requires authentication. Include a valid JWT token in the Authorization header.

Path Parameters

id
UUID
required
The unique identifier of the role to retrieve

Response

id
UUID
Unique identifier of the role
name
string
The name of the role
description
string
The description of the role
permissions
array
List of permissions assigned to this role
id
UUID
Permission unique identifier
name
string
Permission name
description
string
Permission description
status
string
Permission status (ACTIVE, INACTIVE)
status
string
Current status of the role (ACTIVE, INACTIVE)

Error Responses

  • 404 Not Found: Role with the specified ID does not exist
  • 500 Internal Server Error: Unexpected server error

Example Request

curl -X GET https://api.example.com/api/roles/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Administrator",
  "description": "Full system access with all permissions",
  "permissions": [
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "name": "users:write",
      "description": "Permission to create and modify users",
      "status": "ACTIVE"
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440002",
      "name": "users:read",
      "description": "Permission to view user information",
      "status": "ACTIVE"
    }
  ],
  "status": "ACTIVE"
}

Example Error Response

{
  "timestamp": "2024-01-15T10:30:00Z",
  "requestId": "abc-123-def",
  "message": "Role not found",
  "detail": "No role exists with ID: 550e8400-e29b-41d4-a716-446655440000"
}

Build docs developers (and LLMs) love