Skip to main content
POST
/
api
/
alerts
{
  "id": "alt_abc123",
  "name": "CPIX Below 50",
  "type": "cpix_threshold",
  "condition": "below",
  "threshold": 50,
  "geography": "US",
  "active": true,
  "email": "analyst@example.com",
  "created_at": "2025-03-28T14:30:00Z"
}

Authentication

Requires an alert token in the X-Alert-Token header. Obtain a token via the Get Alert Token endpoint.
X-Alert-Token: <your-alert-token>

Request Body

name
string
required
Human-readable name for the alert.
type
string
required
Alert type. One of:
  • cpix_threshold — Trigger when CPIX score crosses a threshold
  • cpix_change — Trigger on CPIX score change
  • sector_pressure — Trigger on sector pressure level
  • signal_severity — Trigger on signal severity
  • series_threshold — Trigger when a data series crosses a threshold
  • weekly_digest — Weekly summary digest
condition
string
required
Trigger condition. One of above, below, rises_by, falls_by, any, high, or medium.
email
string
required
Email address to receive alert notifications.
threshold
number
Numeric threshold for threshold-based alert types.
geography
string
Geographic filter. One of US or UK.
sector_id
string
Sector identifier for sector_pressure alerts.
whatsapp_number
string
Optional WhatsApp number for mobile notifications.
series_key
string
Series key for series_threshold alerts.
min_consecutive
number
Minimum consecutive periods the condition must hold before triggering.

Response

Returns 201 Created with the full alert object.
cURL
curl -X POST "https://api.consumersignals.io/api/alerts" \
  -H "X-Alert-Token: YOUR_ALERT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CPIX Below 50",
    "type": "cpix_threshold",
    "condition": "below",
    "email": "analyst@example.com",
    "threshold": 50,
    "geography": "US"
  }'
Python
import requests

response = requests.post(
    "https://api.consumersignals.io/api/alerts",
    headers={
        "X-Alert-Token": "YOUR_ALERT_TOKEN",
        "Content-Type": "application/json"
    },
    json={
        "name": "CPIX Below 50",
        "type": "cpix_threshold",
        "condition": "below",
        "email": "analyst@example.com",
        "threshold": 50,
        "geography": "US"
    }
)
alert = response.json()
TypeScript
const response = await fetch(
  "https://api.consumersignals.io/api/alerts",
  {
    method: "POST",
    headers: {
      "X-Alert-Token": "YOUR_ALERT_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "CPIX Below 50",
      type: "cpix_threshold",
      condition: "below",
      email: "analyst@example.com",
      threshold: 50,
      geography: "US",
    }),
  }
);
const alert = await response.json();
{
  "id": "alt_abc123",
  "name": "CPIX Below 50",
  "type": "cpix_threshold",
  "condition": "below",
  "threshold": 50,
  "geography": "US",
  "active": true,
  "email": "analyst@example.com",
  "created_at": "2025-03-28T14:30:00Z"
}