Skip to main content

Documentation 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.

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 valid 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.
anio
number
Four-digit year (e.g. 2025). Defaults to the current year.
mes
number
Month number from 1 to 12. Defaults to the current month.
totalVisitas
number
Total visits in the selected month.
totalVisitantes
number
Total visitors across all visits in the selected month.
visitasPorEstado
object
Counts broken down by state: Agendada, Cancelada, Realizada.
visitasPorTipo
object
Counts broken down by visit type: Salón de visitas, Salón + Sala de Comando.
serieTemporal
array
Array of daily data points for chart rendering, each with a date and visit count.
curl -X GET "https://api.example.com/api/estadisticas/admin?anio=2025&mes=8" \
  -H "Authorization: Bearer <token>"
StatusMeaning
200Success — KPI and chart data returned
401Missing or invalid token
500Internal server error

GET /api/estadisticas/rango

Returns aggregated statistics for an arbitrary date range. Both desde 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.
desde
string
required
Start of the range in YYYY-MM-DD format.
hasta
string
required
End of the range in YYYY-MM-DD format. Must be on or after desde.
totalVisitas
number
Total visits within the specified range.
totalVisitantes
number
Total visitors across all visits in the range.
visitasPorEstado
object
Counts broken down by state: Agendada, Cancelada, Realizada.
visitasPorTipo
object
Counts broken down by visit type.
visitasPorInstitucion
array
Ranking of institutions by visit count within the range.
curl -X GET "https://api.example.com/api/estadisticas/rango?desde=2025-01-01&hasta=2025-06-30" \
  -H "Authorization: Bearer <token>"
StatusMeaning
200Success — range statistics returned
400Missing parameters, invalid date format, or desde is after hasta
401Missing or invalid token
500Internal 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 named Reporte_Visitas_<mes>_<anio>.pdf.
anio
number
Four-digit year. Defaults to the current year.
mes
number
Month number from 1 to 12. Defaults to the current month.
Response: Binary application/pdf stream.
Response HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename=Reporte_Visitas_<mes>_<anio>.pdf
curl -X GET "https://api.example.com/api/estadisticas/exportar?anio=2025&mes=8" \
  -H "Authorization: Bearer <token>" \
  --output Reporte_Visitas_8_2025.pdf
StatusMeaning
200PDF generated and returned as binary stream
401Missing or invalid token
500PDF generation failed

GET /api/estadisticas/exportar/diario

Generates and downloads the daily operations schedule as a PDF. The fecha 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.
fecha
string
required
The date for which to generate the schedule, in YYYY-MM-DD format.
Response: Binary application/pdf stream.
Response HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename=Cronograma_<fecha>.pdf
curl -X GET "https://api.example.com/api/estadisticas/exportar/diario?fecha=2025-08-15" \
  -H "Authorization: Bearer <token>" \
  --output Cronograma_2025-08-15.pdf
StatusMeaning
200PDF generated and returned as binary stream
400Missing fecha or invalid date format
401Missing or invalid token
500PDF generation failed

GET /api/estadisticas/exportar/rango

Generates and downloads a PDF report covering all visits in a date range. An optional estados filter lets you narrow the report to specific visit states. The downloaded file is named Reporte_Visitas_<desde>_a_<hasta>.pdf.
desde
string
required
Start of the range in YYYY-MM-DD format.
hasta
string
required
End of the range in YYYY-MM-DD format.
estados
string
Optional comma-separated list of states to include. Valid values: Agendada, Cancelada, Realizada. When omitted, all states are included. Example: estados=Agendada,Realizada.
Response: Binary application/pdf stream.
Response HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename=Reporte_Visitas_<desde>_a_<hasta>.pdf
curl -X GET "https://api.example.com/api/estadisticas/exportar/rango?desde=2025-07-01&hasta=2025-07-31&estados=Agendada,Realizada" \
  -H "Authorization: Bearer <token>" \
  --output Reporte_Visitas_2025-07-01_a_2025-07-31.pdf
StatusMeaning
200PDF generated and returned as binary stream
400Missing or malformed desde / hasta parameters
401Missing or invalid token
500PDF 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 named Comprobante_Visita_<id>.pdf.
id
string
required
The unique identifier of the visit for which to generate the voucher.
Response: Binary application/pdf stream.
Response HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename=Comprobante_Visita_<id>.pdf
curl -X GET "https://api.example.com/api/estadisticas/exportar/visita/42" \
  -H "Authorization: Bearer <token>" \
  --output Comprobante_Visita_42.pdf
StatusMeaning
200PDF voucher generated and returned as binary stream
400Missing visit ID
401Missing or invalid token
500PDF 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.
This endpoint requires the Admin role. Requests from authenticated non-Admin users will receive a 403 Forbidden response.
The downloaded file is named Informe_Estadisticas_<desde>_a_<hasta>.pdf.
desde
string
required
Start of the reporting period in YYYY-MM-DD format.
hasta
string
required
End of the reporting period in YYYY-MM-DD format.
titulo
string
Optional custom title for the report. Defaults to an empty string if omitted.
secciones
string
required
Comma-separated list of sections to include in the report. At least one value is required. Example: secciones=resumen,por_tipo,por_institucion.
Response: Binary application/pdf stream.
Response HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename=Informe_Estadisticas_<desde>_a_<hasta>.pdf
curl -X GET "https://api.example.com/api/estadisticas/exportar/informe?desde=2025-01-01&hasta=2025-06-30&titulo=Informe%20Semestral&secciones=resumen,por_tipo,por_institucion" \
  -H "Authorization: Bearer <token>" \
  --output Informe_Estadisticas_2025-01-01_a_2025-06-30.pdf
StatusMeaning
200Report PDF generated and returned as binary stream
400Missing or malformed date parameters, or secciones is empty
401Missing or invalid token
403Authenticated user does not have the Admin role
500PDF generation failed

Build docs developers (and LLMs) love