Skip to main content
PUT
/
api
/
alerts
/
:id
{
  "id": "alt_abc123",
  "name": "CPIX Below 50",
  "type": "cpix_threshold",
  "condition": "below",
  "threshold": 50,
  "active": false,
  "email": "analyst@example.com"
}

Authentication

Requires an alert token in the X-Alert-Token header. You must own the alert to update it.
X-Alert-Token: <your-alert-token>

Path Parameters

id
string
required
The unique identifier of the alert to update.

Request Body

All fields are optional. Only include the fields you wish to modify.
active
boolean
Set to false to pause the alert, or true to reactivate it.
name
string
Updated alert name.
whatsapp_number
string
Updated WhatsApp number for mobile notifications.
cURL
curl -X PUT "https://api.consumersignals.io/api/alerts/alt_abc123" \
  -H "X-Alert-Token: YOUR_ALERT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"active": false}'
Python
import requests

response = requests.put(
    "https://api.consumersignals.io/api/alerts/alt_abc123",
    headers={
        "X-Alert-Token": "YOUR_ALERT_TOKEN",
        "Content-Type": "application/json"
    },
    json={"active": False}
)
updated_alert = response.json()
TypeScript
const response = await fetch(
  "https://api.consumersignals.io/api/alerts/alt_abc123",
  {
    method: "PUT",
    headers: {
      "X-Alert-Token": "YOUR_ALERT_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ active: false }),
  }
);
const updatedAlert = await response.json();
{
  "id": "alt_abc123",
  "name": "CPIX Below 50",
  "type": "cpix_threshold",
  "condition": "below",
  "threshold": 50,
  "active": false,
  "email": "analyst@example.com"
}