Skip to main content
Notification preferences control which channels InfraAudit sends alerts to, filtered by alert type and severity. Supported channels are Slack (incoming webhook), email, and generic outbound webhook. You can also view delivery history to debug missed notifications. Base path: /api/v1/notifications

GET /notifications/preferences — list preferences

Returns the user’s notification preferences.
GET /api/v1/notifications/preferences
Authorization: Bearer <token>

Response

[
  {
    "id": 1,
    "channel": "slack",
    "alert_type": "security",
    "severity": "critical",
    "webhook_url": "https://hooks.slack.com/services/...",
    "enabled": true
  }
]
channel
string
The notification channel: slack, email, or webhook.
alert_type
string
The type of alerts this preference applies to: security, cost, compliance, performance, or all.
severity
string
Minimum severity to trigger a notification: critical, high, medium, low, or all.

POST /notifications/preferences — create preference

Creates a new notification preference.
POST /api/v1/notifications/preferences
Authorization: Bearer <token>
Content-Type: application/json

Request body

channel
string
required
Notification channel: slack, email, or webhook.
alert_type
string
required
Alert type to notify on: security, cost, compliance, performance, or all.
severity
string
required
Minimum severity: critical, high, medium, low, or all.
webhook_url
string
Required for slack and webhook channels. The destination URL.
{
  "channel": "slack",
  "alert_type": "security",
  "severity": "critical",
  "webhook_url": "https://hooks.slack.com/services/T00000/B00000/XXXX"
}

PUT /notifications/preferences/ — update preference

Updates an existing notification preference.
PUT /api/v1/notifications/preferences/{id}
Authorization: Bearer <token>
Content-Type: application/json

DELETE /notifications/preferences/ — delete preference

Removes a notification preference.
DELETE /api/v1/notifications/preferences/{id}
Authorization: Bearer <token>
Returns 204 No Content.

POST /notifications/test — send test notification

Sends a test ping event to verify a channel endpoint is reachable.
POST /api/v1/notifications/test
Authorization: Bearer <token>
Content-Type: application/json

Request body

channel
string
required
The channel type: slack, email, or webhook.
webhook_url
string
The URL to send the test to. Required for slack and webhook.
{
  "channel": "slack",
  "webhook_url": "https://hooks.slack.com/services/T00000/B00000/XXXX"
}

GET /notifications/history — list delivery history

Returns recent notification delivery records.
GET /api/v1/notifications/history
Authorization: Bearer <token>

Query parameters

channel
string
Filter by channel: slack, email, or webhook.
days
integer
default:"7"
Number of days of history to return.
status
string
Filter by delivery status: sent, failed, or pending.