AgentsIQ

📚 Alert Analyser API Reference

REST API endpoints for OpsGenie alert triage, noise classification and incident management

v1.2.0 Port 8001 FastAPI Base URL: http://<host>:8001

Authentication

All endpoints require: X-API-Key: <BACKEND_API_KEY> header

The backend orchestrator injects the Anthropic API key per-request; agents never store secrets.

Health & Chat

GET /health
Agent health check. Used by backend registry to verify agent is running.
Response
{ "status": "ok", "agent": "alert-analyser", "version": "0.2.0" }
Example
curl -X GET http://localhost:8001/health
POST /invoke
Chat invoke (non-streaming). Runs Claude tool-use loop for question answering.
Request Body
session_id (string) — Chat session ID for history tracking
user_message (string) — User question or command
context (object) — Query context (optional)
  • report_id — UUID of alert report (optional)
  • has_data — Boolean flag if report has loaded data
Response
response — Claude's text response
metadata.tokens_used — Token count for billing
chart (object, optional) — Chart data if response includes visualization
Example
curl -X POST http://localhost:8001/invoke \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "session_id": "abc123", "user_message": "What are the top noisy alerts?", "context": {"report_id": "uuid-here", "has_data": true} }'
POST /invoke/stream
Streaming chat invoke. Response is SSE (Server-Sent Events) stream of text chunks.
Request Body
Same as /invoke
Response
SSE stream of chunks ending with [DONE]

Reports

GET /reports
List all uploaded alert reports with metadata.
Response
Array of report objects:
id — Report UUID
filename — Original filename
total_alerts — Total alerts in report
genuine_count — Classified genuine
noise_count — Classified noise
suspect_count — Classified suspect
status — ready | processing | failed
created_at — Upload timestamp
Example
curl -X GET http://localhost:8001/reports \ -H "X-API-Key: your-api-key"
POST /reports/upload
Upload OpsGenie JSON or CSV export file for analysis.
Request Body
file (file, multipart/form-data) — OpsGenie export (JSON or CSV)
Response
ok — Boolean success
report_id — UUID of created report
total_alerts — Alerts processed
genuine_count — Genuine alerts detected
noise_count — Noise alerts detected
Example
curl -X POST http://localhost:8001/reports/upload \ -H "X-API-Key: your-api-key" \ -F "file=@alerts_export.json"
DELETE /reports/{report_id}
Delete a report and all associated data.
Path Parameters
report_id (UUID) — ID of report to delete
Response
ok — Boolean success
deleted — Report ID that was removed

Dashboard Data

GET /dashboard
Full dashboard overview with classification summary and KPIs.
Query Parameters
report_id (UUID, required) — Report to analyze
Response
total_alerts — Total alerts in report
genuine_count, noise_count, suspect_count — Classification counts
noise_pct, genuine_pct — Percentages
mttr_minutes — Mean time-to-resolution
top_noisy_aliases — Top problematic alerts
team_breakdown — Per-team alert counts
hourly_trend — Alerts by hour chart data
GET /dashboard/trend
Alert volume trend over specified time period.
Query Parameters
report_id (UUID, required) — Report to analyze
period (day|week|month) — Time period to display
Response
data_points — Array of {timestamp, total, genuine, noise}
GET /dashboard/period-summary
Period-over-period comparison (current vs previous).
Query Parameters
report_id (UUID, required) — Report to analyze
Response
current_period — Current stats (total, genuine, noise counts)
previous_period — Previous period stats
change_pct — Percentage change from previous

Incident Management

GET /dashboard/incidents
Escalated Incidents KPI panels and pipeline flow.
Response
pipeline_flow — Counts: escalated, investigating, rca_complete, remediating, resolved, manual
aging — Ticket age buckets, SLA breach count, longest open time
resolution_method — auto_resolved_pct, action_resolved_pct, manual_pct
recurrence_signal — Alerts that re-fired during remediation
GET /dashboard/incidents/list
Filterable incident ticket list for kanban lanes.
Query Parameters
priority (P1|P2|P3|P4) — Filter by priority (optional)
status (string) — Filter by status (optional)
limit (integer, default 6) — Results per page
offset (integer) — Pagination offset
Response
tickets — Array of {id, alert_id, priority, status, title, escalated_at, recurrence_count, sla_breached}
total — Total matching tickets (for pagination)
GET /dashboard/incidents/{ticket_id}
Single ticket detail with full alert payload and RCA findings.
Path Parameters
ticket_id (UUID) — Ticket to retrieve
Response
id — Ticket UUID
alert_id — Source alert ID (dedup key)
status — ESCALATED | INVESTIGATING | RCA_COMPLETE | REMEDIATING | RESOLVED | MANUAL
priority — P1-P4
alert_payload — Full JSONB from source system
rca_findings — RCA Agent findings (optional)
action_outcome — Action Agent outcome (optional)
recurrence_count — Times alert re-fired
timestamps — detected_at, escalated_at, rca_completed_at, resolved_at

Settings & Configuration

GET /settings
Get current agent configuration and noise detection thresholds.
Response
source_type — opsgenie_standalone | opsgenie_cloud | jira_jsm | file
opsgenie_api_key_set — Boolean (key never returned)
sync_interval_minutes — Current sync frequency
noise_threshold_repeat — Repeat count threshold
noise_threshold_close_secs — Auto-close time threshold
POST /settings
Update agent configuration (partial update supported).
Request Body
source_type (string, optional) — Alert source
opsgenie_api_key (string, optional) — API key (encrypted at rest)
opsgenie_base_url (string, optional) — OpsGenie endpoint
sync_interval_minutes (integer, optional) — Sync frequency
noise_threshold_repeat (integer, optional) — Repeat threshold
noise_threshold_close_secs (integer, optional) — Close time threshold
Response
ok — Boolean success
saved_keys — Array of configuration keys that were updated
POST /settings/sync
Trigger manual OpsGenie sync (async).
Response
ok — Boolean success
synced_count — Alerts retrieved from source
genuine_count — Genuine alerts detected
noise_count — Noise alerts detected
tickets_created — New incident tickets created
tickets_updated — Existing tickets updated
GET /settings/test-connection
Test OpsGenie API connectivity and basic permissions.
Response
ok — Boolean (connection works)
latency_ms — Round-trip time to API
alert_count — Alerts available in source

HTTP Status Codes

  • 200 OK — Request succeeded
  • 400 Bad Request — Invalid parameters or file format
  • 401 Unauthorized — Missing or invalid X-API-Key header
  • 404 Not Found — Resource not found (report, ticket)
  • 500 Internal Server Error — Server error or source API unreachable