Role Management Endpoints
GET
/api/roles
PublicRetrieve list of all intern roles with permissions
GET /api/roles Host: api.intern.ylvnyna.com Accept: application/json
{ "data": [ { "id": "role-789", "name": "Senior Intern", "permissions": ["edit_documents", "view_all_interns"], "created_at": "2025-09-01T08:00:00Z" } ] }
POST
/api/roles
ProtectedCreate a new intern role with permissions
POST /api/roles Host: api.intern.ylvnyna.com Content-Type: application/json Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... { "name": "Senior Intern", "permissions": ["edit_documents", "view_all_interns"] }
{ "id": "role-789", "uri": "https://api.intern.ylvnyna.com/api/roles/role-789", "message": "Role created successfully", "created_at": "2025-09-23T14:30:00Z" }
Authentication
Bearer Token Authentication
All protected endpoints require a valid Bearer token in the Authorization header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.xxxxx
Common Response Codes
401
Unauthorized
Missing/invalid authentication token
404
Not Found
Requested role ID does not exist
201
Created
Role created successfully with resource URI