Skip to content

Sending Alerts

Everything a server needs to page a human: one endpoint, one bearer token.

1. Create an integration token

In the dashboard, open API Tokens and create a token. Every token is bound to a target at creation time:

  • a member — alerts go to that person,
  • a group — alerts go to every member of the group,
  • a schedule — alerts go to whoever is on call when the alert fires.

Dashboard: integration token shown once

The raw ap_… token is shown exactly once — only its SHA-256 hash is stored. Copy it into your secret manager immediately. Owner or admin role is required to manage tokens.

2. POST /api/v1/alerts

text
POST https://anypager.app/api/v1/alerts
Authorization: Bearer ap_…
Content-Type: application/json
Idempotency-Key: <optional>
bash
curl -X POST https://anypager.app/api/v1/alerts \
  -H "Authorization: Bearer ap_your_integration_token" \
  -H "Idempotency-Key: deploy-2026-07-17-42" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Production deploy failed",
    "severity": "critical",
    "requires_ack": true
  }'
bash
anypager send --critical "Production deploy failed"

Body fields

FieldTypeRequiredDescription
messagestringyesAlert text, max 1000 characters
severity"normal" | "critical"noDefault "normal". Critical breaks through silence, DND, and Focus
requires_ackbooleannoDefault true. When true, the alert stays pending until acknowledged

The target is not part of the body — it comes from the token. Use separate tokens to reach different members, groups, or schedules.

Response — 202 Accepted

json
{
  "alert_id": "alrt_9k2f…",
  "status": "queued",
  "target": { "type": "member", "id": "usr_…" },
  "recipient_count": 1,
  "duplicate": false
}

Delivery is asynchronous: 202 means the alert is queued and escalation has started.

Idempotency

Pass an Idempotency-Key header (up to 255 characters) to make retries safe. Sending the same key twice returns the original alert with "duplicate": true instead of paging everyone again. Use your CI run id, cron timestamp, or incident id.

Errors

StatusMeaningWhat to do
400Invalid JSON, missing message, message over 1000 chars, bad severity/requires_ackFix the request
401Missing or revoked tokenCheck the Authorization header
402Trial expired or subscription past due (subscribe_url included)Update billing in the dashboard
422The token's target (member/group/schedule) no longer existsRecreate the token with a valid target
429Rate limit exceeded — 60 alerts per minute per tokenBack off and retry
503Alert could not be queuedRetry with the same Idempotency-Key

Rate limits

60 alerts per minute per token. If a burst of failures can exceed that, aggregate on your side — one alert saying "37 checks failing" pages better than 37 alerts anyway.

AnyPager — push-first on-call paging.