The Estadísticas endpoints provide aggregated analytics used by management dashboards, as well as a full suite of PDF export capabilities. All endpoints in this group require a validDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanM84/gestor-visitas/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer <token> header. The /exportar/informe endpoint additionally requires the Admin role. PDF responses return binary application/pdf data with a Content-Disposition: attachment header so browsers trigger a file download automatically.
GET /api/estadisticas/admin
Returns the KPI and chart data that power the Admin management dashboard. Defaults to the current year and month when query parameters are omitted. The response includes visit counts, occupancy rates, breakdowns by visit type, and time-series data suitable for charting.Four-digit year (e.g.
2025). Defaults to the current year.Month number from
1 to 12. Defaults to the current month.Total visits in the selected month.
Total visitors across all visits in the selected month.
Counts broken down by state:
Agendada, Cancelada, Realizada.Counts broken down by visit type:
Salón de visitas, Salón + Sala de Comando.Array of daily data points for chart rendering, each with a date and visit count.
| Status | Meaning |
|---|---|
200 | Success — KPI and chart data returned |
401 | Missing or invalid token |
500 | Internal server error |
GET /api/estadisticas/rango
Returns aggregated statistics for an arbitrary date range. Bothdesde and hasta are required and must follow YYYY-MM-DD format. The desde date must not be later than hasta. Use this endpoint to generate ad-hoc period summaries outside the fixed monthly view.
Start of the range in
YYYY-MM-DD format.End of the range in
YYYY-MM-DD format. Must be on or after desde.Total visits within the specified range.
Total visitors across all visits in the range.
Counts broken down by state:
Agendada, Cancelada, Realizada.Counts broken down by visit type.
Ranking of institutions by visit count within the range.
| Status | Meaning |
|---|---|
200 | Success — range statistics returned |
400 | Missing parameters, invalid date format, or desde is after hasta |
401 | Missing or invalid token |
500 | Internal server error |
GET /api/estadisticas/exportar
Generates and downloads a monthly visits report as a PDF file. Defaults to the current year and month when parameters are omitted. The downloaded file is namedReporte_Visitas_<mes>_<anio>.pdf.
Four-digit year. Defaults to the current year.
Month number from
1 to 12. Defaults to the current month.application/pdf stream.
| Response Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename=Reporte_Visitas_<mes>_<anio>.pdf |
| Status | Meaning |
|---|---|
200 | PDF generated and returned as binary stream |
401 | Missing or invalid token |
500 | PDF generation failed |
GET /api/estadisticas/exportar/diario
Generates and downloads the daily operations schedule as a PDF. Thefecha parameter is required and must be in YYYY-MM-DD format. The downloaded file is named Cronograma_<fecha>.pdf. This is the document used by guides on the day of visits.
The date for which to generate the schedule, in
YYYY-MM-DD format.application/pdf stream.
| Response Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename=Cronograma_<fecha>.pdf |
| Status | Meaning |
|---|---|
200 | PDF generated and returned as binary stream |
400 | Missing fecha or invalid date format |
401 | Missing or invalid token |
500 | PDF generation failed |
GET /api/estadisticas/exportar/rango
Generates and downloads a PDF report covering all visits in a date range. An optionalestados filter lets you narrow the report to specific visit states. The downloaded file is named Reporte_Visitas_<desde>_a_<hasta>.pdf.
Start of the range in
YYYY-MM-DD format.End of the range in
YYYY-MM-DD format.Optional comma-separated list of states to include. Valid values:
Agendada, Cancelada, Realizada. When omitted, all states are included. Example: estados=Agendada,Realizada.application/pdf stream.
| Response Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename=Reporte_Visitas_<desde>_a_<hasta>.pdf |
| Status | Meaning |
|---|---|
200 | PDF generated and returned as binary stream |
400 | Missing or malformed desde / hasta parameters |
401 | Missing or invalid token |
500 | PDF generation failed |
GET /api/estadisticas/exportar/visita/:id
Generates and downloads the official visit voucher (comprobante) for a single visit. The PDF contains the full visit details, group information, and confirmation data. The downloaded file is namedComprobante_Visita_<id>.pdf.
The unique identifier of the visit for which to generate the voucher.
application/pdf stream.
| Response Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename=Comprobante_Visita_<id>.pdf |
| Status | Meaning |
|---|---|
200 | PDF voucher generated and returned as binary stream |
400 | Missing visit ID |
401 | Missing or invalid token |
500 | PDF generation failed (e.g. visit not found in service layer) |
GET /api/estadisticas/exportar/informe
Generates a custom statistics report PDF for a specified date range. The caller selects which statistical sections to include and can supply a custom title. At least one section must be specified. The downloaded file is namedInforme_Estadisticas_<desde>_a_<hasta>.pdf.
Start of the reporting period in
YYYY-MM-DD format.End of the reporting period in
YYYY-MM-DD format.Optional custom title for the report. Defaults to an empty string if omitted.
Comma-separated list of sections to include in the report. At least one value is required. Example:
secciones=resumen,por_tipo,por_institucion.application/pdf stream.
| Response Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename=Informe_Estadisticas_<desde>_a_<hasta>.pdf |
| Status | Meaning |
|---|---|
200 | Report PDF generated and returned as binary stream |
400 | Missing or malformed date parameters, or secciones is empty |
401 | Missing or invalid token |
403 | Authenticated user does not have the Admin role |
500 | PDF generation failed |