SMS Alert API
The SMS Alert API lets you programmatically set up and manage text message notifications for critical monitoring events.
Creating an SMS Alert
To create a new SMS 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": "sms",
"name": "Critical Outage Alert",
"phone_numbers": ["+15551234567", "+15559876543"],
"monitor_ids": ["mon_12345"],
"triggers": ["down"],
"threshold_seconds": 30,
"include_recovery": false
}'
API Parameters
Parameter | Type | Description |
---|---|---|
type | string | Must be “sms” for SMS alerts |
name | string | A descriptive name for this alert |
phone_numbers | array | List of phone numbers to notify (E.164 format) |
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 |
SMS Credit Usage
Each SMS alert consumes one credit per message sent. You can check your remaining SMS credits:
curl -X GET "https://api.uptimekeeper.com/v1/account/credits" \
-H "X-API-Key: your_api_key"
Managing Phone Number Verification
For security, new phone numbers added via the API must be verified:
curl -X POST "https://api.uptimekeeper.com/v1/phone/verify" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+15551234567"
}'