The statistics endpoints provide aggregated data for dashboards and reporting without modifying any records. The threeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gcapella0/agente-inteligente-expedientes/llms.txt
Use this file to discover all available pages before exploring further.
/estadisticas routes are public (no authentication required), while /metricas is JWT-protected and returns the four headline KPI values used by the main dashboard.
GET /estadisticas/expedientes
Dashboard-level summary of dossiers, grouped by a chosen dimension. Authentication: Not required.Query parameters
Grouping dimension. Accepted values:
| Value | Description |
|---|---|
status | Group by docente status (completo, incompleto, activo, …) |
departamento | Group by vinculacion_institucional.departamento |
sede | Group by vinculacion_institucional.sede |
completitud_rango | Group into four fixed bands: 0-25%, 25-50%, 50-75%, 75-100% |
Optional temporal filter. Accepted values:
dia | mes | trimestre | año. Currently passed through as metadata — use it to label chart axes on the frontend.Response 200 OK
The grouped value (status label, department name, sede name, or range string like
"25-50%"). Rows where the field is null in MongoDB are labelled "Sin especificar".Number of docentes in this category.
cantidad / total_docentes × 100, rounded to one decimal place.Total number of docente documents in the database (all statuses).
cURL example
GET /estadisticas/documentos
Document-level analysis, with optional filtering by document type and/or validation status. Authentication: Not required.Query parameters
Filter results to a specific
TipoDocumento value (e.g. cedula_identidad, titulo_universitario). When omitted, all types are included.Filter by validation state. Accepted values:
pendiente | aprobado | rechazado | requiere_revision.Response 200 OK
The 10 document types with the lowest count of non-rejected documents — i.e., the types most likely to be missing from dossiers. Sorted ascending by count.
Counts for all four validation states across the (optionally filtered) document set.
Average
ocr.confianza_promedio over all documents where OCR has been run. 0 if no documents have been processed yet.GET /estadisticas/completitud
Completeness distribution of dossiers, with per-department breakdown and an automated prioritisation recommendation. Authentication: Not required.Query parameters
Comma-separated list of percentage ranges to compute. Each range is expressed as
start-end (integers). Default produces four equal quartile bands.When set to
departamento (or omitted), the response includes a per-department breakdown. Pass sede or status to change the primary grouping axis — note that the detailed breakdown pipeline currently always groups by department regardless of this value.Response 200 OK
One key per requested range. Each value contains
cantidad (docente count) and porcentaje_total (share of all docentes, rounded to one decimal place).Departments sorted descending by
docentes_bajo_50% — the department with the most incomplete dossiers appears first.Auto-generated text recommendation. Returns
"Expedientes en buen estado general" when no department has docentes below 50 % completeness.cURL example
GET /metricas/
Return the four headline KPIs shown on the main dashboard. Authentication:Authorization: Bearer <token> required.
Response 200 OK
Total documents whose
validacion.estado is not rechazado.Average of
completitud.porcentaje across all docentes, rounded to one decimal place. 0.0 if the collection is empty.Count of docentes with
completitud.porcentaje >= 80. These are considered dossier-complete.Total number of docentes registered in the system.
The
docentesAptos threshold is ≥ 80 %, not 100 %. A docente with all mandatory documents present but missing optional ones will be counted as apto once the 80 % threshold is met.