The Reports API covers four distinct resource groups: accounting reports authored by Asesores, an executive KPI dashboard aggregating platform-wide metrics for Admins, announcements broadcast to all authenticated users, and advisor ratings submitted by Clientes. All data is read from the live MySQL database with no caching layer.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Nieto2020/portalhub/llms.txt
Use this file to discover all available pages before exploring further.
Role IDs: Admin = 1, Asesor = 2, Cliente = 3. The
crear.php endpoint for reports is restricted to the Asesor role; the list, detail, and dashboard endpoints are open to any authenticated user.GET /backend/modules/reportes/listar.php
Returns the list of accounting reports. Admin and Cliente users see every report in the system; Asesor users see only the reports they authored (id_asesor = session user). The Asesor filter is applied automatically server-side.
Required role: Any authenticated user
Query parameters: None
Primary key of the report.
User ID of the Asesor who created the report.
Short title of the report.
Summary description of the report’s scope or findings.
Full report body. May be null for drafts that have not yet had content added.
Report period type. One of
Mensual, Trimestral, Anual, or Especial.Publication state. One of
Borrador, Publicado, or Archivado.UTC timestamp when the report row was inserted.
UTC timestamp of the last update (updated automatically by MySQL).
Email address of the authoring Asesor.
Full name from
perfiles.nombre_completo for the authoring Asesor, if a profile exists.Response 200
| Code | Message |
|---|---|
403 | Acceso denegado |
500 | Error en el servidor |
POST /backend/modules/reportes/crear.php
Creates a new accounting report. Only the Asesor role may call this endpoint. The server automatically setsid_asesor from the session — it cannot be overridden in the request body.
Required role: Asesor (id_rol = 2)
Short title of the report. Cannot be empty.
Summary description. Cannot be empty.
Full report body text. Optional; defaults to an empty string for
Borrador reports.Report period type. Allowed values:
Mensual (default), Trimestral, Anual, Especial.Initial publication state. Allowed values:
Borrador (default), Publicado.Archivado is a valid database state but cannot be set on creation — it is reserved for administrative archival operations.Auto-incremented ID of the newly created report.
Response 201
| Code | Message |
|---|---|
400 | Faltan campos requeridos: titulo, descripcion |
400 | Tipo no válido. Opciones: Mensual, Trimestral, Anual, Especial |
400 | Estado no válido. Opciones: Borrador, Publicado |
400 | Título y descripción no pueden estar vacíos |
403 | Acceso denegado |
405 | Método no permitido |
500 | Error en el servidor |
GET /backend/modules/reportes/detalle.php
Fetches a single report by its primary key. Access control: an Asesor can only retrieve reports they authored; an Admin can retrieve any report. Required role: Any authenticated user (with role-based record-level access) Query parametersPrimary key (
id_reporte) of the report to retrieve.Primary key of the report.
User ID of the authoring Asesor.
Title of the report.
Summary description.
Full report body.
Period type:
Mensual, Trimestral, Anual, or Especial.State:
Borrador, Publicado, or Archivado.Creation timestamp.
Last modification timestamp.
Email of the authoring Asesor.
Full name of the authoring Asesor from
perfiles.Asesor’s declared specialty from
perfiles.especialidad.Response 200
| Code | Message |
|---|---|
400 | ID de reporte requerido |
403 | No tienes permiso para ver este reporte |
404 | Reporte no encontrado |
500 | Error en el servidor |
GET /backend/modules/reportes/dashboard.php
Returns aggregated KPI data across users, appointments, accounting services, and billing. All counts are computed with fresh SQL queries on every request. Useful for the admin dashboard overview panel. Required role: Any authenticated user Query parameters: NoneResponse 200
| Code | Message |
|---|---|
401 | No autenticado |
500 | Error al generar reporte |
GET /backend/modules/anuncios/listar.php
Returns the 10 most recent active announcements, ordered newest first. Available to every authenticated user regardless of role. Required role: Any authenticated user Query parameters: NonePrimary key of the announcement.
User ID of the Admin who created the announcement.
Announcement headline.
Full announcement body text.
UTC timestamp when the announcement was published.
Only rows with
activo = 1 are returned. Deactivated announcements are silently excluded.Response 200
| Code | Message |
|---|---|
401 | No autenticado |
500 | Error |
POST /backend/modules/anuncios/crear.php
Creates a new platform-wide announcement. Only Admin may call this endpoint. The new row is inserted withactivo = 1 (the database default), making it immediately visible via the list endpoint.
Required role: Admin (id_rol = 1)
Announcement headline. Cannot be empty.
Full announcement body text. Cannot be empty.
Auto-incremented ID of the newly created announcement.
Response 201
| Code | Message |
|---|---|
400 | Faltan campos requeridos (titulo, contenido) |
400 | Título y contenido no pueden estar vacíos |
403 | Acceso denegado |
405 | Método no permitido |
500 | Error |
POST /backend/modules/calificaciones/crear.php
Allows a Cliente to rate their currently assigned Asesor on a 1–5 integer scale. The server resolvesid_asesor automatically from the active cliente_asesor row — the client does not need to supply the advisor’s ID. A maximum of one rating per client per calendar day is enforced.
Required role: Cliente (id_rol = 3)
Rating score. Must be an integer between
1 and 5 inclusive.Response 201
| Code | Message |
|---|---|
400 | Puntuación debe ser entre 1 y 5 |
400 | No tienes un asesor asignado activo |
400 | Ya has calificado a tu asesor hoy |
403 | Acceso denegado |
405 | Método no permitido |
500 | Error |
GET /backend/modules/calificaciones/estadisticas.php
Returns aggregated rating statistics for every Asesor who has at least one rating and currently holds an active client assignment. Results are ordered bypromedio DESC.
Required role: Admin (id_rol = 1)
Query parameters: None
User ID of the Asesor.
Email address of the Asesor.
Full name from
perfiles.nombre_completo. Falls back to correo when no profile name is set.Number of individual ratings received by this Asesor.
Average rating rounded to one decimal place (e.g.
4.3).Timestamp of the most recent rating received.
Response 200
| Code | Message |
|---|---|
403 | Acceso denegado |
500 | Error |