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.

A monitor is marked down after two failed checks in a row, so one dropped request does not alert anyone. Recovery is reported on the first good check.

Check types

Parameters

FieldTypeRequiredDescription
httpcheck_typeNocallback_url is a full URL. Up when it answers 200. method is GET or POST.
pingcheck_typeNocallback_url is a host name or IP. Up when any of 3 pings is answered.
tcpcheck_typeNocallback_url is host:port (IPv6 as [addr]:port). Up when the port accepts a connection: the “telnet” check.
heartbeatcheck_typeNoWe 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

GET/api/v1/service-alerts/plans

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.

POST/api/v1/service-alerts/package

Parameters

FieldTypeRequiredDescription
variantstringYesA 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

POST/api/v1/service-alerts

Parameters

FieldTypeRequiredDescription
namestringYesUp to 50 characters.
check_typestringYeshttp, ping, tcp or heartbeat.
callback_urlstringYesThe target, in the form its check type needs (above).
methodstringNoGET (default) or POST; http and heartbeat only.
groupstringNoUp to 50 characters. When 3 or more monitors of a group change state in the same pass, one alert lists them all.
recipientsarrayYesAt 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

POST/api/v1/service-alerts/test

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

POST/api/v1/service-alerts/bulk

Parameters

FieldTypeRequiredDescription
check_typestringYesShared by every row.
methodstringNohttp only.
groupstringNoUsed for rows without their own group.
targetsarrayYes1 to 100 of { "callback_url", "name"?, "group"? }. A row without a name is named after its target.
recipientsarrayYesShared 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

GET/api/v1/service-alerts
GET/api/v1/service-alerts/{uuid}
PUT/api/v1/service-alerts/{uuid}
DELETE/api/v1/service-alerts/{uuid}
GET/api/v1/service-alerts/{uuid}/history

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

POST/api/v1/service-alerts/{uuid}/renew

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.