Rol (Role) API
The Role API manages user roles within the transportation request system. Roles define access permissions and are assigned to user profiles to control system capabilities.Endpoints
Create Role
Create a new role entry
List All Roles
Get all active roles (unpaginated)
Get Role
Retrieve a specific role
List Roles
List roles with pagination
Update Role
Update an existing role
Delete Role
Soft delete a role
Create Role
POST /rol Create a new role in the system.Request Body
Unique role code (e.g., “ADMIN”, “SOLICITANTE”, “APROBADOR”)
Role name (e.g., “Administrador”, “Solicitante”, “Aprobador”)
Example
Response
List All Roles
GET /rol/todos/lista Retrieve all active roles without pagination. Ideal for dropdown menus and role assignment forms.Query Parameters
Filter by role code (partial match)
Filter by role name (partial match)
General search across codigo and nombre fields
Example
Get Role by ID
GET /rol/ Retrieve a specific role by its ID.Path Parameters
Role ID
Response
List Roles (Paginated)
GET /rol List roles with pagination and filtering capabilities.Query Parameters
Page number (starts at 1)
Records per page (max 100)
Filter by role code (partial match)
Filter by role name (partial match)
General search across codigo and nombre fields
Example
Response
Update Role
PUT /rol/ Update an existing role. All fields are optional.Path Parameters
Role ID
Request Body
Updated role code (must remain unique)
Updated role name (must remain unique)
Example
Delete Role
DELETE /rol/ Soft delete a role. The role is marked as inactive rather than physically deleted.Path Parameters
Role ID
Example
Response
Response Codes
- 200 - Success
- 201 - Created
- 404 - Role not found
- 409 - Conflict (duplicate codigo or nombre, or role in use)
- 500 - Internal server error
Common Roles
Typical roles in the system include:- ADMIN - System administrator with full access
- SOLICITANTE - User who can create transport requests
- APROBADOR - User who can approve/reject requests
- COORD_TRANS - Transport coordinator managing missions
- MOTORISTA - Driver with mobile app access