Skip to main content
The daily spend cap is a safety net, not a normal operating mode — by the time it fires, your agent is already paused. This recipe wires the 80% warning so you hear about it first, plus the hard stop notification so you know exactly when the cap engaged.

What you’ll build

Two channels, two thresholds:
  1. Slack subscribed to on_cost_threshold — fires at 80% of the daily cap.
  2. Email subscribed to on_pause — fires when the cap actually engages.

Steps

1

Set the threshold in rules

{
  "notifications": {
    "on_cost_threshold_pct": 80,
    "on_pause": true
  }
}
Drop to 50% if you want earlier warnings during initial tuning.
2

Add the Slack channel

Channels → Add → Slack. Paste webhook URL. Subscribe to on_cost_threshold only.
3

Add the email channel

Channels → Add → Email. Target your ops alias. Subscribe to on_pause.
4

Test both

POST /api/v1/agents/{id}/channels/{cid}/test on each — a synthetic event of every subscribed kind lands in the destination.

What you’ll see

At 80%:
:warning: Agent Booking.com hygiene has used 80% of its daily spend cap (4.00/4.00 / 5.00).
At 100%:
Subject: Agent paused — daily spend cap reached Body: Booking.com hygiene reached its daily spend cap of $5.00 and was auto-paused at 14:23 UTC. It will auto-resume at 00:00 in your workspace timezone. No action required unless you want to raise the cap.

Bumping the cap

If you’re consistently hitting cap, raise it in Settings → Cost & limits (or PATCH /api/v1/agents/{id}):
curl -X PATCH https://api.mapping.travel/api/v1/agents/{id} \
  -H 'Authorization: Bearer mt_...' \
  -d '{ "dailySpendCapCents": 1500 }'