Divinux API
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_recentworkflow 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
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/health | Public | Health check for ALB |
Analyses (Incident Insights)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/organizations/:orgId/insights | JWT | List incident insights (paginated) |
| POST | /api/v1/organizations/:orgId/insights | JWT | Request manual analysis |
| GET | /api/v1/organizations/:orgId/insights/stats | JWT | Get analysis statistics |
| GET | /api/v1/organizations/:orgId/insights/:insightId | JWT | Get insight by ID |
| GET | /api/v1/organizations/:orgId/insights/:insightId/events | JWT | Get events for an insight |
RCA Documents
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/organizations/:orgId/rcas | JWT | List RCA documents |
| POST | /api/v1/organizations/:orgId/rcas | JWT | Create RCA document |
| GET | /api/v1/organizations/:orgId/rcas/stats | JWT | Get RCA statistics |
| GET | /api/v1/organizations/:orgId/rcas/search-incidents | JWT | Search incidents across surfaces |
| GET | /api/v1/organizations/:orgId/rcas/:rcaId | JWT | Get RCA by ID |
| PATCH | /api/v1/organizations/:orgId/rcas/:rcaId | JWT | Update RCA |
| DELETE | /api/v1/organizations/:orgId/rcas/:rcaId | JWT | Delete RCA |
| POST | /api/v1/organizations/:orgId/rcas/:rcaId/generate | JWT | Generate AI draft |
Incident Links
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/organizations/:orgId/rcas/:rcaId/incidents | JWT | List linked incidents |
| POST | /api/v1/organizations/:orgId/rcas/:rcaId/incidents | JWT | Link incident to RCA |
| DELETE | /api/v1/organizations/:orgId/rcas/:rcaId/incidents/:linkId | JWT | Unlink incident |
Action Items
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/organizations/:orgId/rcas/:rcaId/action-items | JWT | List action items |
| POST | /api/v1/organizations/:orgId/rcas/:rcaId/action-items | JWT | Create action item |
| PATCH | /api/v1/organizations/:orgId/rcas/:rcaId/action-items/:itemId | JWT | Update action item |
| DELETE | /api/v1/organizations/:orgId/rcas/:rcaId/action-items/:itemId | JWT | Delete action item |
Webhook Configuration
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/organizations/:orgId/webhooks | JWT | List webhook configs |
| POST | /api/v1/organizations/:orgId/webhooks | JWT | Create webhook config |
| GET | /api/v1/organizations/:orgId/webhooks/:configId | JWT | Get webhook config |
| PATCH | /api/v1/organizations/:orgId/webhooks/:configId | JWT | Update webhook config |
| DELETE | /api/v1/organizations/:orgId/webhooks/:configId | JWT | Delete webhook config |
| POST | /api/v1/organizations/:orgId/webhooks/:configId/regenerate-key | JWT | Regenerate API key |
Ingestion (Webhooks & Deploys)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/v1/webhooks/ingest/:apiKey | Public (API Key) | Ingest a webhook event (alerting/synthetics/external) |
| POST | /api/v1/organizations/:orgId/deploy-events/ingest/:apiKey | Public (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
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/organizations/:orgId/usage | JWT | Get usage statistics |
| PATCH | /api/v1/organizations/:orgId/usage | JWT | Update usage limits |
Users
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/users/me | JWT | Get current user profile |
| PATCH | /api/v1/users/me | JWT | Update user profile |
| GET | /api/v1/users/me/notifications | JWT | Get notification preferences |
| PATCH | /api/v1/users/me/notifications | JWT | Update notification preferences |
| GET | /api/v1/users/me/subscription | JWT | Get subscription status |
| POST | /api/v1/users/me/subscription/checkout | JWT | Initiate checkout |
| POST | /api/v1/users/me/subscription/portal | JWT | Get billing portal link |
| GET | /api/v1/organizations/:orgId/users | JWT | List users in organization |
| POST | /api/v1/organizations/:orgId/users/invite | JWT | Invite 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)
| Table | Purpose |
|---|---|
analyses | AI-generated incident insights |
analysis_events | Analysis processing events |
rcas | Root cause analysis documents |
rca_incident_links | Links between RCAs and incidents |
rca_action_items | Action items for RCAs |
webhook_configs | Webhook ingestion configurations |
deploy_events | Deploy events for deploy-aware correlation |
tenant_budgets | Per-org usage budgets |
Testing
Run tests with:
npm run test:divinux