Skip to main content

Divinux API

Renamed from Insights

This document was formerly the Insights API reference. The app was renamed to Divinux in Phase C (apps/insights/apps/divinux/), and insights.statux.io was retired 2026-06-17. This page was renamed from insights-api to divinux-api; the content below describes the current Divinux API.

Divinux is the unified Statux product API. It runs on port 3003 and is served at divinux-api.statux.io. It hosts what were previously four separate product APIs — Statuspages, Alerting, Synthetics, and Insights — folded into a single application (Phases C5/D5/E5, May 2026). The AI incident-analysis capability that gave this doc its original name is now one feature area among several.

Overview

The Divinux API (apps/divinux/) is the AI-SRE mission-control backend. It powers:

  • Status pages — public status pages, components, incidents, maintenance windows, subscribers
  • Alerting — alerts, alert events, teams, schedules, escalation policies, workflow automation, Slack/Teams/Discord integrations
  • Synthetics — checks, check results, relays, multi-region execution, aggregations
  • AI insights — automated incident analysis, root cause analysis (RCA), incident correlation, and the agentic command-room loop (investigator, runbook, comms, on-call agents)

Folded product surfaces mount under prefixes — for example /api/v1/synthetics/organizations/:orgId/... and /api/v1/statuspages/organizations/:orgId/... — while the core alerting and insights surfaces mount directly under /api/v1/organizations/:orgId/....

Core Concepts (AI Insights)

Analyses

An Analysis is an AI-generated insight for an incident event:

  • Automatically triggered on P1/P2 alerts (which open command rooms) and via webhook ingestion
  • Can also be manually requested by users
  • Powered by AWS Bedrock for AI processing
  • Tracks analysis events for audit purposes

RCA Documents

A Root Cause Analysis (RCA) document is a structured post-mortem:

  • Links to incidents and alerts within Divinux
  • Tracks action items with assignees and status
  • Supports AI-generated drafts via Bedrock, enriched with recent deploys and prior resolved incidents
  • Includes statistics and reporting

Deploy Events

Deploy events feed deploy-aware correlation:

  • Ingested via POST /api/v1/organizations/:orgId/deploy-events/ingest/:apiKey (reuses the service webhook key)
  • Surfaced in the command-room "Recent Deploys" view and weighed heavily by the investigator agent
  • Drive the deploy_recent workflow condition

Webhook Ingestion

Webhook ingestion brings external and cross-surface events in:

  • Each webhook config generates a unique API key
  • Supports optional HMAC-SHA256 signature verification
  • Feeds alert creation, grouping, and the auto-investigation loop

Usage Budgets

Usage tracking monitors AI consumption:

  • Per-organization usage limits
  • Configurable budget thresholds
  • Usage statistics per organization

Module Structure

apps/divinux/src/
├── modules/
│ ├── alerting/ # Alerts, teams, schedules, escalation, workflows
│ ├── synthetics/ # Checks, results, relays, aggregations
│ ├── statuspages/ # Status pages, components, incidents, subscribers
│ ├── analysis/ # AI incident analysis CRUD and stats
│ ├── rca/ # RCA documents, incidents, action items
│ ├── webhooks/ # Webhook ingestion and config management
│ ├── deploy-events/ # Deploy ingestion and deploy-aware correlation
│ ├── budget/ # Usage tracking and limits
│ ├── bedrock/ # AWS Bedrock AI integration
│ └── users/ # User profiles and subscriptions
├── health/ # Health check endpoint
├── entities/ # TypeORM entities
├── migrations/ # Database migrations (divinux schema + cross-schema backfills)
├── data-source.ts # TypeORM data source config
└── main.ts # Application bootstrap

Endpoints

Health

MethodEndpointAuthDescription
GET/api/v1/healthPublicHealth check for ALB

Analyses (Incident Insights)

MethodEndpointAuthDescription
GET/api/v1/organizations/:orgId/insightsJWTList incident insights (paginated)
POST/api/v1/organizations/:orgId/insightsJWTRequest manual analysis
GET/api/v1/organizations/:orgId/insights/statsJWTGet analysis statistics
GET/api/v1/organizations/:orgId/insights/:insightIdJWTGet insight by ID
GET/api/v1/organizations/:orgId/insights/:insightId/eventsJWTGet events for an insight

RCA Documents

MethodEndpointAuthDescription
GET/api/v1/organizations/:orgId/rcasJWTList RCA documents
POST/api/v1/organizations/:orgId/rcasJWTCreate RCA document
GET/api/v1/organizations/:orgId/rcas/statsJWTGet RCA statistics
GET/api/v1/organizations/:orgId/rcas/search-incidentsJWTSearch incidents across surfaces
GET/api/v1/organizations/:orgId/rcas/:rcaIdJWTGet RCA by ID
PATCH/api/v1/organizations/:orgId/rcas/:rcaIdJWTUpdate RCA
DELETE/api/v1/organizations/:orgId/rcas/:rcaIdJWTDelete RCA
POST/api/v1/organizations/:orgId/rcas/:rcaId/generateJWTGenerate AI draft
MethodEndpointAuthDescription
GET/api/v1/organizations/:orgId/rcas/:rcaId/incidentsJWTList linked incidents
POST/api/v1/organizations/:orgId/rcas/:rcaId/incidentsJWTLink incident to RCA
DELETE/api/v1/organizations/:orgId/rcas/:rcaId/incidents/:linkIdJWTUnlink incident

Action Items

MethodEndpointAuthDescription
GET/api/v1/organizations/:orgId/rcas/:rcaId/action-itemsJWTList action items
POST/api/v1/organizations/:orgId/rcas/:rcaId/action-itemsJWTCreate action item
PATCH/api/v1/organizations/:orgId/rcas/:rcaId/action-items/:itemIdJWTUpdate action item
DELETE/api/v1/organizations/:orgId/rcas/:rcaId/action-items/:itemIdJWTDelete action item

Webhook Configuration

MethodEndpointAuthDescription
GET/api/v1/organizations/:orgId/webhooksJWTList webhook configs
POST/api/v1/organizations/:orgId/webhooksJWTCreate webhook config
GET/api/v1/organizations/:orgId/webhooks/:configIdJWTGet webhook config
PATCH/api/v1/organizations/:orgId/webhooks/:configIdJWTUpdate webhook config
DELETE/api/v1/organizations/:orgId/webhooks/:configIdJWTDelete webhook config
POST/api/v1/organizations/:orgId/webhooks/:configId/regenerate-keyJWTRegenerate API key

Ingestion (Webhooks & Deploys)

MethodEndpointAuthDescription
POST/api/v1/webhooks/ingest/:apiKeyPublic (API Key)Ingest a webhook event (alerting/synthetics/external)
POST/api/v1/organizations/:orgId/deploy-events/ingest/:apiKeyPublic (API Key)Ingest a deploy event for deploy-aware correlation

The webhook ingestion endpoint accepts events from the alerting and synthetics surfaces and external systems. An optional x-webhook-signature header can be provided for HMAC-SHA256 payload verification.

Usage

MethodEndpointAuthDescription
GET/api/v1/organizations/:orgId/usageJWTGet usage statistics
PATCH/api/v1/organizations/:orgId/usageJWTUpdate usage limits

Users

MethodEndpointAuthDescription
GET/api/v1/users/meJWTGet current user profile
PATCH/api/v1/users/meJWTUpdate user profile
GET/api/v1/users/me/notificationsJWTGet notification preferences
PATCH/api/v1/users/me/notificationsJWTUpdate notification preferences
GET/api/v1/users/me/subscriptionJWTGet subscription status
POST/api/v1/users/me/subscription/checkoutJWTInitiate checkout
POST/api/v1/users/me/subscription/portalJWTGet billing portal link
GET/api/v1/organizations/:orgId/usersJWTList users in organization
POST/api/v1/organizations/:orgId/users/inviteJWTInvite user to organization

Key Entities

Analysis Entity

@Entity({ schema: 'divinux', name: 'analyses' })
export class Analysis extends BaseEntity {
organizationId: string;
incidentId: string;
status: string; // pending, processing, completed, failed
summary: string;
rootCause: string;
recommendations: string;
severity: string;
sourceProduct: string; // alerting, synthetics
}

RCA Entity

@Entity({ schema: 'divinux', name: 'rcas' })
export class Rca extends BaseEntity {
organizationId: string;
title: string;
status: string; // draft, in_review, published
summary: string;
rootCause: string;
impact: string;
timeline: string;
createdBy: string;
}

Database

Divinux uses the divinux schema in PostgreSQL (which absorbed the old statuspages/alerts/synthetics/insights schemas in Phase D.5; some legacy alerts.* tables persist). All entities follow the snake_case naming convention for database columns.

Key Tables (AI Insights)

TablePurpose
analysesAI-generated incident insights
analysis_eventsAnalysis processing events
rcasRoot cause analysis documents
rca_incident_linksLinks between RCAs and incidents
rca_action_itemsAction items for RCAs
webhook_configsWebhook ingestion configurations
deploy_eventsDeploy events for deploy-aware correlation
tenant_budgetsPer-org usage budgets

Testing

Run tests with:

npm run test:divinux