The Roles API implements role-based access control (RBAC). A role (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JorLOrT/rappi2/llms.txt
Use this file to discover all available pages before exploring further.
Rol) groups a set of permissions (Permiso). Each permission grants a specific accion on a named recurso. Every user is assigned exactly one role, and their allowed operations are derived from the permissions attached to that role.
All endpoints require a valid Bearer token. Read operations require roles:read; mutations require roles:write; deletion of roles requires roles:delete.
Available resources and actions
recurso | Description |
|---|---|
usuarios | User accounts |
roles | Roles and permissions |
sesiones | Refresh token sessions |
clientes | Client records and addresses |
ordenes | Delivery orders, payments, invoices |
conductores | Driver records |
vehiculos | Vehicle fleet |
asignaciones | Delivery assignments |
rutas | Planned routes and stops |
tracking | GPS pings |
geocercas | Geofences |
incidencias | Incident reports and evidence |
notificaciones | Notifications |
reportes | Analytics and reporting endpoints |
auditoria | HTTP audit logs |
* | Wildcard — matches any resource |
accion | Description |
|---|---|
read | List and retrieve |
write | Create and update |
delete | Delete or revoke |
* | Wildcard — grants all actions |
GET /api/roles/
List all roles together with their associated permissions. Authentication:Bearer token required.Permission required:
roles:read
Response — 200 OK
Returns an array ofRolResponse objects.
Auto-incremented role ID.
Unique role name. Maximum 50 characters.
Permissions assigned to this role.
POST /api/roles/
Create a new role. The new role starts with no permissions; add them withPOST /api/roles/{rol_id}/permisos.
Authentication: Bearer token required.Permission required:
roles:write
Request body
Unique role name. Maximum 50 characters.
Response — 201 Created
Returns the createdRolResponse.
GET /api/roles/
Retrieve a single role by ID, including all its permissions. Authentication:Bearer token required.Permission required:
roles:read
Path parameters
ID of the role to retrieve.
Response — 200 OK
Returns aRolResponse. See GET /api/roles/ for the field list.
PATCH /api/roles/
Update a role’s name. Invalidates the permission cache for the role. Authentication:Bearer token required.Permission required:
roles:write
Path parameters
ID of the role to update.
Request body
New unique name for the role. Maximum 50 characters.
Response — 200 OK
Returns the updatedRolResponse.
DELETE /api/roles/
Delete a role permanently. The role must have no users assigned to it — reassign any existing users before deleting. Authentication:Bearer token required.Permission required:
roles:delete
Path parameters
ID of the role to delete.
Response — 204 No Content
No response body is returned on success.GET /api/roles/permisos/all
List all permissions across all roles, with optional filters. Authentication:Bearer token required.Permission required:
roles:read
Query parameters
Filter permissions to a specific role.
Filter permissions to a specific resource name (e.g.
usuarios, ordenes).Response — 200 OK
Returns an array ofPermisoResponse objects.
Permission ID.
ID of the role this permission belongs to.
Resource name.
Granted action (
read, write, delete, or *).GET /api/roles/permisos/
Retrieve a single permission by ID. Authentication:Bearer token required.Permission required:
roles:read
Path parameters
ID of the permission to retrieve.
Response — 200 OK
Returns aPermisoResponse. See GET /api/roles/permisos/all for the field list.
POST /api/roles//permisos
Add a permission to a role. The combination ofrol_id, recurso, and accion must be unique. Invalidates the permission cache for the role.
Authentication: Bearer token required.Permission required:
roles:write
Path parameters
ID of the role to add the permission to.
Request body
Resource name the permission applies to (e.g.
usuarios, ordenes, or *).Action to grant:
read, write, delete, or *.Response — 201 Created
Returns the createdPermisoResponse.
DELETE /api/roles//permisos/
Remove a permission from a role. Invalidates the permission cache for the role. Authentication:Bearer token required.Permission required:
roles:write
Path parameters
ID of the role that owns the permission.
ID of the permission to remove.