POST /api/roles
Creates a new role with the specified name and optional description. Roles are used to group permissions and can be assigned to users.Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header.Request Body
The name of the role. Must be unique and cannot be blank.
- Maximum length: 100 characters
- Example:
"Administrator"
Optional description of the role’s purpose and responsibilities.
- Maximum length: 200 characters
- Example:
"Full system access with all permissions"
Response
Unique identifier for the created role
The name of the role
The description of the role
Current status of the role (ACTIVE, INACTIVE)
Error Responses
- 400 Bad Request: Invalid data provided (e.g., blank name, exceeds length limits)
- 409 Conflict: A role with this name already exists
- 500 Internal Server Error: Unexpected server error