Skip to main content

Usage alerts (the Watchdog)

The Watchdog checks every SIM's and pool's usage against alert rules you set. When a rule fires it emails your alert contacts, sends a webhook, logs it, and (if the rule says so) suspends the SIM, or every SIM in the pool.

Two kinds of rule​

typeFires whenaction
thresholdUsage passes a percentage of the allowance (thresholdPercent, 1 to 100)warn or suspend
burn_rateAt the current rate, the whole allowance will be used before the month ends (checked once the month, or the SIM's first month, is 5 days in)warn only

Each rule fires at most once a day for the same SIM or pool, so you won't be flooded.

Where rules apply​

ScopeHow to make itApplies to
simsimId setThat SIM
poolpoolId setThat pool as a whole
accountneither setThe default for every pool, and every SIM not in a pool, that has no rules of its own

If a SIM (or pool) has any rules of its own, the account defaults don't apply to it. A SIM in a pool is covered by its pool's rules (the pool shares one allowance), unless you give that SIM rules of its own. Those are measured against the SIM's share of the pool (poolShareBytes), and the pool's rules still cover the pool as a whole.

You can have several threshold rules in one place (say, warn at 80% and suspend at 100%), but only one auto-suspend rule and one burn-rate rule per SIM, pool or account.

Set up a sensible default​

POST/api/v1/watchdog/alertsTry it →

A warning at 80% and a burn-rate warning for everything, as the account default:

for body in \
'{ "type": "threshold", "action": "warn", "thresholdPercent": 80 }' \
'{ "type": "burn_rate", "action": "warn" }'
do
curl -X POST https://app.zentarinetworks.com/api/v1/watchdog/alerts \
-H "Authorization: Bearer $AXIS_API_KEY" \
-H "Content-Type: application/json" \
-d "$body"
done

And a hard stop for one SIM that must never go over:

{ "simId": 4183, "type": "threshold", "action": "suspend", "thresholdPercent": 100 }

201 Created:

{
"id": 21,
"scope": "sim",
"poolId": null,
"simId": 4183,
"type": "threshold",
"action": "suspend",
"thresholdPercent": 100,
"isActive": true,
"lastTriggeredAt": null,
"createdAt": "2026-10-08T15:02:11Z",
"updatedAt": "2026-10-08T15:02:11Z"
}

Reacting to alerts​

Each alert arrives as a webhook: watchdog.sim.threshold, watchdog.sim.burn_rate, watchdog.pool.threshold or watchdog.pool.burn_rate. The payloads are on Webhooks. Typical responses:

  • A warning: tell the customer or driver, or buy a top-up automatically.
  • A suspension ("action": "suspend"): the SIM is already being suspended. To bring it back, top up with "reactivate": true, or raise its allowance and reactivate it. Or leave it: if Switch suspended SIMs back on next month is ticked in the portal (Settings > Tenant), it comes back on by itself at the start of next month, when usage resets.

Managing rules​

GET/api/v1/watchdog/alertsTry it →
All rules, or one scope: ?scope=account, ?scope=pool&poolId=7, ?scope=sim&simId=4183
PATCH/api/v1/watchdog/alerts/{id}Try it →
Change type, action, thresholdPercent, or send "isActive": false to pause it (true turns it back on)
DELETE/api/v1/watchdog/alerts/{id}Try it →
Removes it
GET/api/v1/watchdog/logsTry it →
What the Watchdog noticed and did, newest first. Filter by simId, poolId, level (info, warning, suspend), date or search

The Watchdog's actions and rule changes also appear in your event log with "type": "watchdog".

Exempting a SIM or pool​

Some SIMs must never be suspended, whatever they use (a payment terminal, an alarm). Exempt them and the Watchdog ignores them completely: no alerts, no auto-suspend.

PUT/api/v1/sims/{id}/watchdog-exemptionTry it →
PUT/api/v1/pools/{id}/watchdog-exemptionTry it →
{ "exempt": true }

Send { "exempt": false } to monitor it again. Each SIM and pool shows watchdogExempt.

What can go wrong​

AnswerWhy
400thresholdPercent missing or outside 1 to 100 on a threshold rule, or a burn-rate rule set to suspend
404The SIM or pool isn't yours (or the pool isn't active)
409 conflictA second auto-suspend or burn-rate rule in the same place, or a threshold rule that duplicates one already there