The four roles
ADMIN
Full access to all tickets and all operations across every area. Manages users, configuration, and system-wide data.
MESA
Help-desk agents. Full access to all tickets. Can assign, transfer, reclassify, and reopen tickets across all areas.
AREA
Department staff. Can view and act on tickets only within their own area. Cannot assign, transfer, reclassify, or reopen tickets.
USUARIO
The ticket requester. No account or authentication required. Interacts only through the public endpoints (
/crear and /consultar).USUARIO is not a JWT role — it represents unauthenticated requesters who submit and track tickets without logging in.Permissions matrix
The table below maps every ticket endpoint to the roles that can call it.| Endpoint | ADMIN | MESA | AREA | USUARIO |
|---|---|---|---|---|
POST /tickets/crear | — | — | — | ✓ |
POST /tickets/consultar | — | — | — | ✓ |
GET /tickets/dashboard | ✓ | ✓ | ✓ | — |
GET /tickets/dashboard-metricas | ✓ | ✓ | ✓ | — |
GET /tickets/{ticket_id} | ✓ | ✓ | ✓ | — |
POST /tickets/{ticket_id}/actualizar | ✓ | ✓ | ✓ | — |
POST /tickets/{ticket_id}/pausar | ✓ | ✓ | ✓ | — |
POST /tickets/{ticket_id}/cancelar | ✓ | ✓ | ✓ | — |
POST /tickets/{ticket_id}/archivar | ✓ | ✓ | ✓ | — |
POST /tickets/{ticket_id}/asignar | ✓ | ✓ | — | — |
POST /tickets/{ticket_id}/transferir | ✓ | ✓ | — | — |
POST /tickets/{ticket_id}/reclasificar | ✓ | ✓ | — | — |
POST /tickets/{ticket_id}/reabrir | ✓ | ✓ | — | — |
Area-based scoping for the AREA role
When a user with theAREA role accesses a specific ticket, the API compares the ticket’s assigned area against the user’s area. If they do not match, the request is rejected with 403 No autorizado para acceder a este ticket.
- Fetching a single ticket (
GET /tickets/{ticket_id}) - Updating, pausing, cancelling, and archiving a ticket
- Dashboard and metrics views (rows are filtered server-side)
Role in the JWT token
After a successful login, the API issues a JWT whose payload includes the user’s role and area:rol claim through the require_roles dependency:
Authorization header of every authenticated request:
Managing users
User accounts are created with arol field that must be one of the four valid values:
area field for any user with the AREA role — this value is what the server uses for area-based ticket scoping.