Read, acknowledge and snooze alerts over the API

The 1Monitor REST API now covers alerts. A script can list the open alerts, read each one’s timeline, acknowledge one for the team member who takes it, or snooze it. An on-call bot in your chat, a wall display or a weekly incident summary no longer needs anyone to copy alerts out of the app.

List the open alerts

Shell
curl "https://public-api.1monitor.io/v1/alerts?status=open" \
  -H "Authorization: Bearer $ONEMONITOR_API_KEY"

Alerts come newest first, in pages of up to 200. Narrow them by status, type, monitor or project, and by when they started with started_after and started_before. Each alert says whether it is acknowledged or snoozed and until when, who it is assigned to, and whether it is flapping.

/v1/alerts/{uuid}/events returns the alert’s timeline in the order it happened. That is the opening, each notification sent, each action, each comment and the recovery. A weekly report can rebuild what happened to an alert without anyone opening the app.

Acknowledge or snooze from a script

Shell
curl -X POST https://public-api.1monitor.io/v1/alerts/$ALERT_UUID/acknowledge \
  -H "Authorization: Bearer $ONEMONITOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"duration_hours": 4, "assignee": "'$USER_UUID'"}'

The acknowledgment lasts from 1 to 24 hours. Add assignee to hand the alert to a team member, or leave it out to keep the current one. /snooze takes the same duration_hours and holds the notifications instead. /unacknowledge and /unsnooze end them early.

Acknowledge and snooze work on an open alert for a missed or failed run. Any other alert answers 409 with alert_not_actionable, including one that resolved a moment before your request arrived.

Actions over the API show on the alert’s timeline with the key’s name, such as “Acknowledged for 4h by API key ‘on-call bot’”. Name each key after the tool that uses it, and the timeline tells you which one acted.

Filter monitors by tag

Shell
curl "https://public-api.1monitor.io/v1/monitors?tag=backups" \
  -H "Authorization: Bearer $ONEMONITOR_API_KEY"

GET /v1/monitors now takes a tag. It matches one tag, ignoring case, and combines with project. A script that checks every backup monitor no longer has to fetch them all and filter on its side.

Scopes and plans

Reading alerts needs the alerts:read scope, and the four actions need alerts:write. Owners and admins create keys under Account settings, API keys. A key never gains a scope added after it was created, Full access included. So a key made before these scopes existed needs replacing before it can read alerts.

The API is available on Standard and higher plans, and on Free during the 14-day trial. Request limits per plan are on the pricing page.

Every field, filter and error code is in the REST API reference. What acknowledging does to escalation is in acknowledge alerts and escalation.

See every cron job you run, and know when one breaks.

Get started free