Skip to main content

Overview

The Alerts API provides access to intelligent alerts generated by TamboEngine, the AI-powered analysis system that monitors production data and identifies potential issues, anomalies, and optimization opportunities.

Base URL

/alertas
Authentication Required: Yes (cookie-based JWT authentication)

Get All Alerts

curl -X GET "https://api.tambo360.com/alertas/c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f?rango=7" \
  -H "Cookie: token=<jwt_token>"
Retrieves the historical alerts for a specific establishment with optional date range filtering.

Path Parameters

idEstablecimiento
string
required
UUID of the establishment to query alerts for

Query Parameters

rango
integer
Number of days to look back from today. For example, rango=7 returns alerts from the last 7 days.If not specified, returns all historical alerts.

Response

statusCode
integer
HTTP status code (200 for success)
message
string
“Alertas obtenidas correctamente”
data
array
Array of alert objects:
idAlerta
string
UUID of the alert
idEstablecimiento
string
Associated establishment UUID
tipo
string
Alert type/severity (e.g., “warning”, “critical”, “info”)
titulo
string
Alert title/summary
descripcion
string
Detailed alert description
visto
boolean
Whether the alert has been marked as seen by the user
fechaCreacion
string
Alert creation timestamp (ISO 8601)
fechaAnalisis
string
Timestamp of the TamboEngine analysis that generated this alert
success
boolean
Indicates success (true)
{
  "statusCode": 200,
  "message": "Alertas obtenidas correctamente",
  "data": [
    {
      "idAlerta": "h7i8j9k0-1cde-67ef-1234-89012cdef345",
      "idEstablecimiento": "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f",
      "tipo": "warning",
      "titulo": "Aumento inusual en mermas",
      "descripcion": "Se detectó un incremento del 35% en las mermas de tipo 'Natural' comparado con el promedio histórico.",
      "visto": false,
      "fechaCreacion": "2026-03-08T10:30:00.000Z",
      "fechaAnalisis": "2026-03-08T10:00:00.000Z"
    },
    {
      "idAlerta": "i8j9k0l1-2def-78f0-2345-90123def4567",
      "idEstablecimiento": "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f",
      "tipo": "info",
      "titulo": "Producción de quesos en aumento",
      "descripcion": "La producción de quesos ha aumentado un 12% este mes, superando el objetivo mensual.",
      "visto": true,
      "fechaCreacion": "2026-03-05T15:20:00.000Z",
      "fechaAnalisis": "2026-03-05T15:00:00.000Z"
    }
  ],
  "success": true
}

Get Latest Alerts

curl -X GET https://api.tambo360.com/alertas/c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f/ultimas \
  -H "Cookie: token=<jwt_token>"
Retrieves the most recent alerts generated from the latest TamboEngine analysis run.

Path Parameters

idEstablecimiento
string
required
UUID of the establishment

Response

{
  "statusCode": 200,
  "message": "Últimas alertas obtenidas correctamente",
  "data": [
    {
      "idAlerta": "h7i8j9k0-1cde-67ef-1234-89012cdef345",
      "idEstablecimiento": "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f",
      "tipo": "warning",
      "titulo": "Aumento inusual en mermas",
      "descripcion": "Se detectó un incremento del 35% en las mermas de tipo 'Natural' comparado con el promedio histórico.",
      "visto": false,
      "fechaCreacion": "2026-03-08T10:30:00.000Z",
      "fechaAnalisis": "2026-03-08T10:00:00.000Z"
    },
    {
      "idAlerta": "j9k0l1m2-3ef0-89f1-3456-01234ef56789",
      "idEstablecimiento": "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f",
      "tipo": "critical",
      "titulo": "Costos significativamente elevados",
      "descripcion": "Los costos directos del último lote exceden el promedio en un 45%. Revisar conceptos de 'leche_cruda' y 'refrigeracion'.",
      "visto": false,
      "fechaCreacion": "2026-03-08T10:30:00.000Z",
      "fechaAnalisis": "2026-03-08T10:00:00.000Z"
    }
  ],
  "success": true
}

Mark Alert as Seen

curl -X PUT https://api.tambo360.com/alertas/h7i8j9k0-1cde-67ef-1234-89012cdef345/visto \
  -H "Cookie: token=<jwt_token>"
Marks a specific alert as seen/read by the user.

Path Parameters

idAlerta
string
required
UUID of the alert to mark as seen

Response

{
  "statusCode": 200,
  "message": "Alerta marcada como vista correctamente",
  "data": {
    "idAlerta": "h7i8j9k0-1cde-67ef-1234-89012cdef345",
    "visto": true,
    "fechaVisto": "2026-03-08T16:45:00.000Z"
  },
  "success": true
}

Get Unseen Alerts Count

curl -X GET https://api.tambo360.com/alertas/c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f/no-vistas \
  -H "Cookie: token=<jwt_token>"
Retrieves the count of unseen alerts for an establishment. Useful for notification badges.

Path Parameters

idEstablecimiento
string
required
UUID of the establishment

Response

{
  "statusCode": 200,
  "message": "Conteo de alertas no vistas obtenido correctamente",
  "data": {
    "count": 5,
    "idEstablecimiento": "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f"
  },
  "success": true
}

Alert Types

TamboEngine generates different types of alerts based on the severity and nature of the finding:

Critical

High-priority alerts requiring immediate attention:
  • Significant cost overruns
  • Extreme waste levels
  • Production anomalies affecting quality or safety

Warning

Medium-priority alerts indicating potential issues:
  • Unusual patterns in production
  • Above-average waste levels
  • Cost increases trending upward

Info

Informational alerts about positive trends or achievements:
  • Production goals met or exceeded
  • Efficiency improvements
  • Cost optimization opportunities

TamboEngine Analysis

TamboEngine is Tambo360’s AI-powered analysis engine that:
  1. Analyzes production data from batches, costs, and waste
  2. Identifies patterns and anomalies using machine learning
  3. Generates actionable alerts to help optimize operations
  4. Runs periodically to provide up-to-date insights
Alerts include context-aware recommendations based on historical data and industry benchmarks.

Use Cases

Real-time Notifications

  • Poll /alertas/{id}/ultimas for new alerts
  • Display unseen count using /alertas/{id}/no-vistas
  • Mark alerts as read when user views them

Historical Analysis

  • Use rango parameter to analyze alert patterns over time
  • Identify recurring issues
  • Track improvement after corrective actions

Alert Management

  • Filter alerts by establishment
  • Track which alerts have been addressed
  • Monitor critical vs. informational alerts

Error Responses

400 Bad Request

  • Missing establishment ID or alert ID
  • Invalid UUID format

401 Unauthorized

  • Missing or invalid authentication token

404 Not Found

  • Alert does not exist
  • Establishment has no alerts

500 Internal Server Error

  • TamboEngine analysis error
  • Database connection issues

Build docs developers (and LLMs) love