Notifications & Alerts

Operations for managing automated notification rules, alerting triggers, and retrieved event notifications.

Endpoints

GET NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules
POST NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules
GET NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules/:ruleId
PATCH NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules/:ruleId
DELETE NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules/:ruleId
GET NEXT_PUBLIC_API_URL/projects/:projectId/notifications
GET NEXT_PUBLIC_API_URL/projects/:projectId/notifications/unread-count
POST NEXT_PUBLIC_API_URL/projects/:projectId/notifications/mark-read
GET NEXT_PUBLIC_API_URL/webhooks/slack

GET NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules

Lists all notification and alert rules configured for the project.

Sample response

{
  "rules": [
    {
      "id": "rule_01h8abc...",
      "projectId": "3b290947-8a3d-4cbf-8468-b328a6fcf7bb",
      "name": "High Error Spike Alert",
      "sendToApp": true,
      "sendToEmail": true,
      "config": {
        "trigger": "anomaly_detected",
        "severity": "critical",
        "recipients": [
          { "type": "project_owner" }
        ]
      },
      "createdAt": "2026-02-12T09:30:00.000Z"
    }
  ]
}

POST NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules

Creates a new notification or alerting rule.

Request body

PropertyTypeDescription
namestringRequired. Rule name (1-255 characters).
configobjectRequired. Trigger configuration: trigger, severity, eventName, metric, recipients.
sendToAppboolean(optional, default true) Deliver notification in-app.
sendToEmailboolean(optional, default false) Deliver notification via email.
integrationIdsarray(optional) Array of integration IDs (e.g. Slack webhook integration).
{
  "name": "Checkout Spike Alert",
  "config": {
    "trigger": "event_received",
    "eventName": "purchase",
    "severity": "info",
    "recipients": [
      {
        "type": "project_owner"
      }
    ]
  },
  "sendToApp": true,
  "sendToEmail": false
}

GET NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules/:ruleId

Fetches configuration for a specific notification rule.


PATCH NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules/:ruleId

Updates an existing notification rule.

Request body

Supports partial updates to name, config, sendToApp, sendToEmail, and integrationIds.


DELETE NEXT_PUBLIC_API_URL/projects/:projectId/notification-rules/:ruleId

Deletes a notification rule.


GET NEXT_PUBLIC_API_URL/projects/:projectId/notifications

Returns paginated list of generated notifications for the project.

Parameters

ParameterTypeDescription
sourcestring(optional) Filter by notification source.
typestring(optional) Filter by notification type.
severitystring(optional) Severity level (critical, warning, info).
limitnumber(optional, default 50) Max records to retrieve (1-100).
offsetnumber(optional, default 0) Record offset.

Sample response

{
  "notifications": [
    {
      "id": "notif_01...",
      "projectId": "3b290947-8a3d-4cbf-8468-b328a6fcf7bb",
      "title": "Unusual traffic spike detected",
      "message": "Visitor volume increased by 250% over baseline.",
      "severity": "warning",
      "createdAt": "2026-02-18T14:00:00.000Z"
    }
  ]
}

GET NEXT_PUBLIC_API_URL/projects/:projectId/notifications/unread-count

Returns count of unread notifications.

Sample response

{
  "count": 3
}

POST NEXT_PUBLIC_API_URL/projects/:projectId/notifications/mark-read

Marks notifications as read.

Request body

{
  "ids": ["notif_01..."]
}

GET NEXT_PUBLIC_API_URL/webhooks/slack

Handles Slack App OAuth redirect and installation callbacks to connect workspace channels with project alerts.