Ecuador’s territory is organised into provinces, each subdivided into cantons. Every UZDI (Unidad de Sustentabilidad y Desarrollo Integral) office is anchored to a specific canton, creating a three-level geographic hierarchy that drives the organisational structure of the entire system.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Zapiony/PUCE_UZDI_2026/llms.txt
Use this file to discover all available pages before exploring further.
seguridad.prsn) carries a uzdi_id foreign key that assigns them to one UZDI office. This determines their data scope — dashboards, adolescent lists, and reports are all filtered by the user’s assigned UZDI.
All paths are prefixed with /api/v1. A valid JWT must be supplied as Authorization: Bearer <token> on every request. Mutation endpoints (POST / PATCH / DELETE) require the Administrador or Superadministrador role; GET endpoints are open to all authenticated roles.
Geographic Hierarchy
UZDI Offices
UZDI_BACK/src/estructura-institucional/uzdi/uzdi.controller.ts
UZDI offices are the organisational root of the system. The ParametrosView in the frontend calls uzdiService.getById() and uzdiService.update() to display and edit the active office’s configuration.
Endpoints
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /api/v1/uzdi | All authenticated | List all UZDI offices |
GET | /api/v1/uzdi/:id | All authenticated | Retrieve a single UZDI office |
POST | /api/v1/uzdi | Administrador, Superadministrador | Create a new UZDI office |
PATCH | /api/v1/uzdi/:id | Administrador, Superadministrador | Update office details |
DELETE | /api/v1/uzdi/:id | Administrador, Superadministrador | Remove a UZDI office |
Path Parameters
Integer UZDI office ID (
uzdi_id in the database). Coerced with +id in the controller.UZDI Entity Fields
DB table:estructura_institucional.uzdi — primary key column uzdi_id.
Auto-incremented primary key (
uzdi_id in the database).Foreign key referencing
estructura_institucional.canton.cntn_id. Determines which canton this office belongs to.Full name of the UZDI office. Max 255 characters.
Administrative zone label (e.g., Zona 1 — Norte). Max 100 characters.
Street address of the office. Max 255 characters. Optional.
Contact phone number. Max 20 characters. Optional.
Institutional email address. Max 100 characters. Optional.
ISO-8601 timestamp set automatically by the database on insert. Read-only; not accepted in POST/PATCH bodies.
ISO-8601 timestamp updated automatically by the database on every change. Read-only.
POST / PATCH Body
Integer canton ID. Must reference an existing record in
estructura_institucional.canton.Office name. Must be non-empty, 1–255 characters.
Zone label. Must be non-empty, 1–100 characters.
Street address. Optional. Max 255 characters.
Contact phone number. Optional. Max 20 characters.
Institutional email. Optional. Max 100 characters.
List all UZDI offices — cURL
Get one UZDI office — cURL
Update a UZDI office — cURL
Create a UZDI office — cURL
Frontend integration —
ParametrosView. The uzdiService (UZDI_FRONT/src/services/uzdi.service.ts) exposes exactly two methods: getById(id) and update(id, payload), which map to GET /api/v1/uzdi/:id and PATCH /api/v1/uzdi/:id respectively. The ParametrosView reads the current user’s uzdi_id from the auth store and calls getById on mount to populate the Organización section; saving calls update with a partial UzdiDto.Provincias (Provinces)
UZDI_BACK/src/estructura-institucional/provincia/provincia.controller.ts
Provinces are the top tier of the geographic hierarchy. In practice, province records are seeded from Ecuador’s official 24 provinces and rarely change; mutation endpoints exist for administrative completeness.
Endpoints
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /api/v1/provincia | All authenticated | List all provinces |
GET | /api/v1/provincia/:id | All authenticated | Retrieve a single province |
POST | /api/v1/provincia | Administrador, Superadministrador | Create a province |
PATCH | /api/v1/provincia/:id | Administrador, Superadministrador | Update a province |
DELETE | /api/v1/provincia/:id | Administrador, Superadministrador | Remove a province |
Path Parameters
Integer province ID (
prov_id in the database).Provincia Entity Fields
DB table:estructura_institucional.provincia — primary key column prov_id.
Auto-incremented primary key (
prov_id in the database).Province name (e.g., Pichincha, Guayas). Max 100 characters.
Server-managed creation timestamp. Read-only.
Server-managed last-modified timestamp. Read-only.
POST / PATCH Body
Province name. Must be non-empty, 1–100 characters.
List all provinces — cURL
Create a province — cURL
Cantones (Cantons)
UZDI_BACK/src/estructura-institucional/canton/canton.controller.ts
Cantons are the second tier of the hierarchy, each belonging to exactly one province via the prov_id foreign key. Cantons are used to group UZDI offices geographically and also populate the canton dropdown in the AdolescenteForm.
Endpoints
| Method | Path | Roles | Description |
|---|---|---|---|
GET | /api/v1/canton | All authenticated | List all cantons |
GET | /api/v1/canton/:id | All authenticated | Retrieve a single canton |
POST | /api/v1/canton | Administrador, Superadministrador | Create a canton |
PATCH | /api/v1/canton/:id | Administrador, Superadministrador | Update a canton |
DELETE | /api/v1/canton/:id | Administrador, Superadministrador | Remove a canton |
Path Parameters
Integer canton ID (
cntn_id in the database).Canton Entity Fields
DB table:estructura_institucional.canton — primary key column cntn_id.
Auto-incremented primary key (
cntn_id in the database).Foreign key referencing
estructura_institucional.provincia.prov_id.Canton name (e.g., Quito, Guayaquil, Cuenca). Max 100 characters.
Server-managed creation timestamp. Read-only.
Server-managed last-modified timestamp. Read-only.
POST / PATCH Body
Integer province ID. Must reference an existing record in
estructura_institucional.provincia.Canton name. Must be non-empty, 1–100 characters.
List all cantons — cURL
Create a canton — cURL
Update a canton — cURL
UZDI as Organisational Root
Every user record in
seguridad.prsn carries a uzdi_id column that determines which office the user belongs to. This FK is set at user creation time (via POST /api/v1/users) and used by the backend to scope data access. The useCatalogos composable loads the full list of UZDI offices at session start so that admin forms can present an office picker without an extra round-trip.Cascading deletes are not configured. Deleting a UZDI office that still has associated users, adolescents, or attendance records will produce a foreign-key constraint violation at the database level. Always reassign or archive dependent records before removing geographic hierarchy entries.
Role Reference
| Role constant | Display name |
|---|---|
Rol.ADMINISTRADOR | Administrador |
Rol.SUPERADMINISTRADOR | Superadministrador |
Rol.TRABAJADOR_SOCIAL | Trabajador Social |
Rol.PSICOLOGO | Psicólogo |
Rol.EDUCADOR | Educador |
Rol.JURIDICO | Jurídico |