Create Role
Create a custom role with permissions.
Endpoint
POST /api/v1/roles
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Content-Type | Yes | application/json |
Request Body
{
"name": "Custom Developer",
"permissions": ["workspace.read", "workspace.write"],
"organization_id": 1
}
Response
Success (201)
{
"success": true,
"data": {
"role": {
"id": 1,
"name": "Custom Developer",
"permissions": ["workspace.read", "workspace.write"],
"created_at": "2024-01-01T00:00:00Z"
},
"message": "Role created successfully"
},
"message": "Role created successfully"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Validation error |
| 401 | UNAUTHORIZED | Invalid or missing token |
| 403 | FORBIDDEN | Insufficient permissions |
| 409 | ROLE_ALREADY_EXISTS | Role already exists |
Features
- Custom role creation
- Permission assignment
- Role validation
- Audit logging
Status
[WARNING] TODO: Not Implemented
This endpoint is defined in the router but the implementation logic is not yet complete.