API·AU Panamericana · Ramal Pilar
MF

Endpoints

Base URL · https://api.cajanegra.ai

GET
/v1/events
Lista de eventos con filtros por rango, dispositivo, tipo y patente.
GET
/v1/events/:id
Detalle completo del evento con imagen firmada.
GET
/v1/devices
Inventario de nodos con estado, salud y telemetría.
GET
/v1/devices/:id/telemetry
Serie de temperatura, humedad, señal y uptime.
GET
/v1/alerts
Alertas activas y resueltas con severidad y estado.
POST
/v1/alerts/:id/ack
Confirmación operativa de una alerta.
GET
/v1/stats/traffic
Estadísticas agregadas por hora, día, mes o corredor.
POST
/v1/webhooks
Suscripción a eventos por webhook firmado (HMAC).

Autenticación

Bearer token

// Header
Authorization: Bearer sk_prod_a3f…9c1

Ejemplo · curl

curl https://api.cajanegra.ai/v1/events?limit=100 \
  -H "Authorization: Bearer sk_prod_a3f…9c1"

Ejemplo · JavaScript

const r = await fetch(
  "https://api.cajanegra.ai/v1/events",
  { headers: { Authorization: `Bearer ${token}` } }
);
const { events } = await r.json();

Webhooks

Eventos entregados con firma HMAC

event.created
alert.triggered
alert.acknowledged
device.online
device.offline
device.degraded
device.firmware_updated
vehicle.blacklist_hit
vehicle.wanted_hit