Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/desarrolladorandres2026-gif/Native-tailwind/llms.txt

Use this file to discover all available pages before exploring further.

The Reports section is the primary moderation tool for the Debuta platform. Users can flag other users directly from the mobile app, and every report lands in this view for admin review. The same section of the backend also exposes the growth analytics and support ticket endpoints used by the Dashboard and Statistics panels.

User Reports

Reports are submitted by users from inside the mobile app and stored in the Reporte collection. Each report captures the reporter, the reported user, a categorized reason, and an optional free-text description.

Supported Report Reasons

ValueLabel
spamSpam
contenido_inapropiadoContenido inapropiado
comportamiento_ofensivoComportamiento ofensivo
perfil_falsoPerfil falso
acosoAcoso
otroOtro

Report Statuses

StatusMeaning
pendienteNewly submitted, not yet reviewed
revisadoAcknowledged by an admin
resueltoAction has been taken
The sidebar badge next to Reportes shows the current count of pendiente reports, updated automatically whenever the Dashboard stats refresh.

Fetching Reports

GET /api/admin/reports?page=1&limit=20&estado=pendiente
Authorization: Bearer <admin-token>
The estado filter is optional. Omit it to retrieve all reports regardless of status. The response populates both the reportadoPor and reportado fields with name, username, email, and profile picture. Response:
{
  "reportes": [
    {
      "_id": "...",
      "reportadoPor": {
        "first_name": "Carlos",
        "username": "carlosm",
        "correo": "carlos@example.com",
        "profile_picture": { "url": "https://..." }
      },
      "reportado": {
        "first_name": "Javier",
        "username": "javierg",
        "correo": "javier@example.com",
        "activo": true
      },
      "motivo": "acoso",
      "descripcion": "Mensajes repetitivos después de bloqueo.",
      "estado": "pendiente",
      "createdAt": "2024-11-03T14:22:00.000Z"
    }
  ],
  "total": 8,
  "page": 1,
  "pages": 1
}

Report Actions

Update Report Status

Transition a report to revisado or resuelto without banning the reported user.
PUT /api/admin/reports/:id/status
Authorization: Bearer <admin-token>
Content-Type: application/json

{
  "estado": "revisado"
}
Valid values are "pendiente", "revisado", and "resuelto". The updated report document is returned in the response body.

Ban Reported User

If the report warrants an account ban, use the dedicated ban endpoint. This performs two operations atomically: it sets activo: false on the reported user’s account and advances the report status to resuelto.
POST /api/admin/reports/:id/ban
Authorization: Bearer <admin-token>
Response:
{
  "message": "Usuario baneado y reporte resuelto correctamente"
}
Once a user is banned, the Banear button in the report row is replaced with the text “Baneado” to prevent duplicate actions.
Banning from a report uses the same activo: false mechanism as toggling a user in the Users section. The ban can be reversed at any time from the Users table using the Activar action.

Dashboard Stats

The Dashboard KPI cards call this endpoint on load and every 30 seconds.
GET /api/admin/stats
Authorization: Bearer <admin-token>
Response fields:
FieldDescription
totalUsuariosTotal registered accounts
usuariosHoyAccounts created today
usuariosSemanaAccounts created in the last 7 days
usuariosMesAccounts created in the last 30 days
totalMatchesConfirmed matches (esMatch: true)
matchesHoyMatches formed today
totalMensajesTotal messages sent across all conversations
reportesPendientesReports with status pendiente
totalAsociadosActive accounts with role asociado
usuariosActivosAccounts with activo: true
usuariosInactivosAccounts with activo: false
usuariosOnlineUsers currently connected via Socket.IO

Growth Analytics

The Statistics section and the Dashboard growth chart both use this endpoint.
GET /api/admin/growth?days=30
Authorization: Bearer <admin-token>
The days parameter controls the time window for the daily registration series (supported values used by the UI: 7, 30, 90). The other aggregations always return full platform data regardless of the days value. Response fields:
FieldDescription
registrosPorDiaDaily registration counts for the specified window
porGeneroUser distribution by gender field
porPaisTop 10 countries by user count
porCiudadTop 10 cities by user count
reportesPorMotivoReport count grouped by motivo — used for the Statistics pie chart
porProveedorDistribution by auth_provider (e.g., google, local)

Support Tickets

Support tickets submitted from the mobile app are managed from the Soporte section. The same admin token is used for all three support endpoints.

List Tickets

GET /api/admin/soporte?page=1&limit=20&estado=abierto
Authorization: Bearer <admin-token>
The estado filter accepts: abierto, en_revision, resuelto, cerrado.

Update Ticket

Update the ticket status and optionally store an admin reply that is visible to the user.
PUT /api/admin/soporte/:id
Authorization: Bearer <admin-token>
Content-Type: application/json

{
  "estado": "resuelto",
  "respuesta_admin": "Your issue has been resolved. Please update the app."
}

Ticket Stats

Returns a summary count used to populate the support KPI cards and the sidebar badge.
GET /api/admin/soporte/stats
Authorization: Bearer <admin-token>
Response:
{
  "abiertos": 5,
  "enRevision": 2,
  "resueltos": 18,
  "noLeidos": 3
}

Associates List

GET /api/admin/asociados?page=1&limit=20
Authorization: Bearer <admin-token>
Returns all users with rol: "asociado", enriched with their real-time online status and appointment statistics (citasPendientes, citasAceptadas) derived from Match documents tagged with recomendacion.asociadoId.

Build docs developers (and LLMs) love