Skip to content

Alerts

Endpoints for managing risk alerts.

GET /alerts

Paginated list of alerts.

Request:

bash
GET /api/v1/alerts
Authorization: Bearer <token>

Query Parameters:

  • page (int, default: 1) - Page number
  • size (int, default: 20) - Items per page
  • status (string) - Filter by status (open, under_investigation, resolved, dismissed)
  • severity (string) - Filter by severity (low, medium, high, critical)

Example:

bash
curl "https://api.gbfiscalai.srv1164291.hstgr.cloud/api/v1/alerts?status=open" \
  -H "Authorization: Bearer <token>"

Response:

json
{
  "items": [
    {
      "id": 1,
      "title": "Undervaluation detected",
      "description": "Declared value below reference price",
      "alert_type": "anomaly",
      "severity": "critical",
      "status": "open",
      "declaration_id": 42,
      "created_at": "2026-01-12T10:00:00Z"
    }
  ],
  "total": 25,
  "page": 1,
  "size": 20,
  "pages": 2
}

GET /alerts/id

Details of a specific alert.

Request:

bash
GET /api/v1/alerts/1
Authorization: Bearer <token>

Response:

json
{
  "id": 1,
  "title": "Undervaluation detected",
  "severity": "critical",
  "status": "open",
  "declaration": {
    "id": 42,
    "reference": "DEC-2026-00042"
  },
  "created_at": "2026-01-12T10:00:00Z"
}

PATCH /alerts/id

Updates the status of an alert.

Request:

bash
PATCH /api/v1/alerts/1
Authorization: Bearer <token>
Content-Type: application/json

Body:

json
{
  "status": "resolved",
  "resolution_notes": "Verification completed"
}

Response:

json
{
  "id": 1,
  "status": "resolved",
  "resolved_at": "2026-01-12T15:00:00Z"
}

Alert Types

  • anomaly - Value anomaly detected
  • document - Missing or suspicious document
  • pattern - Suspicious behavioral pattern
  • fraud - Potential fraud

Alert Schema

typescript
interface Alert {
  id: number
  title: string
  description: string
  alert_type: string
  severity: string
  status: string
  declaration_id: number
  created_at: string
  updated_at: string
}

Ministry of Finance - Guinea-Bissau