Help › UserAlertX - text alerts to your own phone
Send an alert from code (API)
One POST request sends an alert. Your API key is on your account screen.
curl -s -X POST https://useralertx.com/cgi-bin/itmessages.cgi \
-H "X-Api-Key: YOUR_API_KEY" \
--data-urlencode "body=Backup finished, no errors"
Fields
body: the alert text.title: optional; put in front of the text as "Title: body".subject: optional; the email Subject line, for email delivery only.method: optional;smsoremailfor this one alert.target: optional safety check; the request fails if it doesn't match your verified phone or email.
Fields can be a form or a JSON object, like {"body":"Backup finished"}.
Answers
- 200 sent: on its way.
- 202 held_pending_optin: your phone hasn't replied START yet. A START text was just sent; reply to it.
- 402 suspended: the trial is over or you are out of tokens.
- 403 stopped: you replied STOP; send START to turn texts back on.
- 401: the API key is missing or wrong.
- 429: over the limit of 10 an hour or 50 a day.
WarningYour API key works like a password. Keep it in your own computer's settings or a secrets store, never in a shared template or a public project. If it leaks, press Regenerate on your account screen.
NoteWriting your own client? Send a User-Agent header with your program's name. Some default ones (Python's urllib) are blocked.
Full reference: https://useralertx.com/integrate.html