Skip to main content

Overview

The Dashboard API provides aggregated production metrics, trends, and analytics data for visualization and business intelligence. It offers monthly summaries and historical production graphs.

Base URL

/dashboard
Authentication Required: Yes (all endpoints require cookie-based JWT authentication)

Get Current Month Summary

curl -X GET https://api.tambo360.com/dashboard/mes-actual \
  -H "Cookie: token=<jwt_token>"
Retrieves production metrics for the current month with percentage variations compared to the previous month.

Response

statusCode
integer
HTTP status code (200 for success)
message
string
“Resumen del mes actual”
data
object
Monthly summary data:
actual
object
Current month metrics:
leches
number
Total milk production (in kg or liters)
quesos
number
Total cheese production (in kg)
mermas
number
Total waste amount
costos
number
Total direct costs
variaciones
object
Percentage changes from previous month:
leches
number
Milk production variation (nullable if no previous data)
quesos
number
Cheese production variation (nullable if no previous data)
mermas
number
Waste variation (nullable if no previous data)
costos
number
Costs variation (nullable if no previous data)
mesPrevio
string
Name of the previous month (e.g., “Febrero”)
success
boolean
Indicates success (true)
{
  "statusCode": 200,
  "message": "Resumen del mes actual",
  "data": {
    "actual": {
      "leches": 1200,
      "quesos": 850,
      "mermas": 35,
      "costos": 42000
    },
    "variaciones": {
      "leches": 12.5,
      "quesos": -5.2,
      "mermas": 3.1,
      "costos": 8.7
    },
    "mesPrevio": "Febrero"
  },
  "success": true
}

Get Production Graph Data

curl -X GET "https://api.tambo360.com/dashboard/grafico?producto=quesos&metrica=cantidad" \
  -H "Cookie: token=<jwt_token>"
Retrieves aggregated production data for the last 6 months plus the current month, filtered by product category and metric type. Useful for generating production trend charts.

Query Parameters

producto
string
required
Product category to analyze. Valid values:
  • leches: Milk products
  • quesos: Cheese products
metrica
string
required
Metric to calculate. Valid values:
  • cantidad: Production quantity
  • mermas: Waste amount
  • costos: Direct costs

Response

statusCode
integer
HTTP status code (200 for success)
message
string
“Resumen de los ultimo 6 meses”
data
object
Graph data:
resultado
array
Array of monthly data points (up to 7 months):
mes
string
Month name in Spanish (e.g., “Marzo”, “Febrero”)
anio
integer
Year (e.g., 2026)
valor
number
Aggregated value for the specified metric
lote
boolean
Indicates if there are batches in the queried period
success
boolean
Indicates success (true)
{
  "statusCode": 200,
  "message": "Resumen de los ultimo 6 meses",
  "data": {
    "resultado": [
      {
        "mes": "Septiembre",
        "anio": 2025,
        "valor": 650
      },
      {
        "mes": "Octubre",
        "anio": 2025,
        "valor": 720
      },
      {
        "mes": "Noviembre",
        "anio": 2025,
        "valor": 680
      },
      {
        "mes": "Diciembre",
        "anio": 2025,
        "valor": 890
      },
      {
        "mes": "Enero",
        "anio": 2026,
        "valor": 750
      },
      {
        "mes": "Febrero",
        "anio": 2026,
        "valor": 820
      },
      {
        "mes": "Marzo",
        "anio": 2026,
        "valor": 850
      }
    ],
    "lote": true
  },
  "success": true
}

Understanding Variations

The variaciones field in the monthly summary shows percentage changes:
  • Positive values (e.g., 12.5): Indicates an increase compared to the previous month
  • Negative values (e.g., -5.2): Indicates a decrease compared to the previous month
  • Null values: No data available for the previous month (first month of operation)

Calculation Formula

Variation % = ((Current Month - Previous Month) / Previous Month) × 100

Use Cases

Monthly Performance Dashboard

Use /dashboard/mes-actual to display:
  • Current month production totals
  • Month-over-month performance indicators
  • Cost trends and efficiency metrics

Production Trend Charts

Use /dashboard/grafico to generate:
  • Line charts showing production over time
  • Cost analysis graphs
  • Waste trend visualization
  • Comparative analysis between product categories

Error Responses

400 Bad Request

  • Missing required query parameters (producto or metrica)
  • Invalid product category (must be “leches” or “quesos”)
  • Invalid metric (must be “cantidad”, “mermas”, or “costos”)
  • User has no registered establishment

401 Unauthorized

  • Missing or invalid authentication token

500 Internal Server Error

  • Unexpected server error
  • Database calculation errors

Build docs developers (and LLMs) love