Creating SMS Alerts via API

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

ParameterTypeDescription
typestringMust be “sms” for SMS alerts
namestringA descriptive name for this alert
phone_numbersarrayList of phone numbers to notify (E.164 format)
monitor_idsarrayList of monitor IDs to trigger this alert
triggersarrayEvent types that trigger the alert (down, degraded, etc.)
threshold_secondsintegerHow long a condition must persist before alerting
include_recoverybooleanWhether 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"
  }'