Uptime Monitor
Watch websites, APIs, servers and ports. We check each monitor every 5 minutes and send an SMS and an email to its alert list when it goes down, and again when it is back.
Endpoints live under /api/v1/ with a JWT or an mbs_ token carrying team:service-alerts:view (read) or team:service-alerts:manage (add, change, buy). Monthly fees come from your wallet; alert SMS are paid from your SMS units.
Check types
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| http | check_type | No | callback_url is a full URL. Up when it answers 200. method is GET or POST. |
| ping | check_type | No | callback_url is a host name or IP. Up when any of 3 pings is answered. |
| tcp | check_type | No | callback_url is host:port (IPv6 as [addr]:port). Up when the port accepts a connection: the “telnet” check. |
| heartbeat | check_type | No | We call your URL with {"serviceId": "<monitor uuid>"}; you answer serviceId, lastRunTime and minTimeInMinutes. Down when the last run is older than that. |
Private, internal and carrier-NAT addresses are refused: the checks run from the internet.
Prices and packages
Returns the price list (plans: variant, name, monitors, monthly_fee), your current package with monitors_used and monitor_limit, your wallet_balance, and paying_monitors: how many of your monitors are billed one by one. The single variant is the price of one monitor on its own.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| variant | string | Yes | A package variant from the plans, e.g. starter, business, pro. |
Without a package this charges the package fee and moves your monitors billed one by one onto it, up to its size. With a package, only a larger one is accepted, and you pay the difference for the days left in the month (charged in the reply). Monitors in a package cost nothing on their own and renew with it. Free monitors stay free and never use a package slot.
# Paste your token once (it starts with mbs_):
export MOBILESASA_TOKEN="mbs_your_token_here"
curl -X POST https://api.mobilesasa.com/api/v1/service-alerts/package \
-H "Authorization: Bearer $MOBILESASA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"variant": "business"
}'Add a monitor
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Up to 50 characters. |
| check_type | string | Yes | http, ping, tcp or heartbeat. |
| callback_url | string | Yes | The target, in the form its check type needs (above). |
| method | string | No | GET (default) or POST; http and heartbeat only. |
| group | string | No | Up to 50 characters. When 3 or more monitors of a group change state in the same pass, one alert lists them all. |
| recipients | array | Yes | At least one { "msisdn": "0712345678", "email": "" }; either field may be empty. |
With a package that has a free slot, the monitor uses it at no charge. Without a package, the single-monitor price is taken from your wallet for the first month. A full package refuses the monitor with a validation error.
# Paste your token once (it starts with mbs_):
export MOBILESASA_TOKEN="mbs_your_token_here"
curl -X POST https://api.mobilesasa.com/api/v1/service-alerts \
-H "Authorization: Bearer $MOBILESASA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Mail server",
"check_type": "tcp",
"callback_url": "mail.example.co.ke:587",
"group": "Head office",
"recipients": [
{
"msisdn": "0712345678",
"email": "[email protected]"
}
]
}'Test a target first
Same check_type, method and callback_url as above (not heartbeat). Runs one check and returns up and a detail line. Up to 10 tests per team every 10 minutes.
Add many at once
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| check_type | string | Yes | Shared by every row. |
| method | string | No | http only. |
| group | string | No | Used for rows without their own group. |
| targets | array | Yes | 1 to 100 of { "callback_url", "name"?, "group"? }. A row without a name is named after its target. |
| recipients | array | Yes | Shared by every monitor. |
All or none: every row is checked first. If any row is refused the reply has created: 0 and row_errors (row, 1-based, and error), and nothing is added or charged. Otherwise created and the new monitors, charged once.
List, read, change, delete
A monitor carries fee_basis (standard, free, override or package), monthly_fee, group_name and, in a package, package_uuid. PUT takes name, method, callback_url, group and recipients; the check type cannot change. Deleting a monitor in a package frees its slot. history lists each time it went down or came back.
Renewal
Monitors on their own renew from the wallet each month at the fee they were bought at; this endpoint renews one now. A package renews as one, carrying its monitors. When the wallet cannot pay, a single monitor is switched off; an unpaid package ends and its monitors become single monitors, switched off, which you can renew or put on a new package.