Email Alert API
The Email Alert API allows you to programmatically create, manage, and customize email notifications for your monitoring events.
Creating an Email Alert
To create a new email alert, send a POST request to the alerts endpoint:
curl -X POST "https://api.uptimekeeper.com/v1/alerts" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "email",
"name": "Website Down Alert",
"recipients": ["admin@example.com", "team@example.com"],
"monitor_ids": ["mon_12345", "mon_67890"],
"triggers": ["down", "degraded"],
"threshold_seconds": 60,
"include_recovery": true
}'
API Parameters
Parameter | Type | Description |
---|---|---|
type | string | Must be “email” for email alerts |
name | string | A descriptive name for this alert |
recipients | array | List of email addresses to notify |
monitor_ids | array | List of monitor IDs to trigger this alert |
triggers | array | Event types that trigger the alert (down, degraded, etc.) |
threshold_seconds | integer | How long a condition must persist before alerting |
include_recovery | boolean | Whether to send notifications when services recover |
Updating an Email Alert
To update an existing email alert, send a PUT request:
curl -X PUT "https://api.uptimekeeper.com/v1/alerts/alert_12345" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"recipients": ["newemail@example.com", "team@example.com"]
}'
Deleting an Email Alert
To delete an email alert, send a DELETE request:
curl -X DELETE "https://api.uptimekeeper.com/v1/alerts/alert_12345" \
-H "X-API-Key: your_api_key"