Create monitor
Creates a new uptime monitor. type must be http, tcp, or ping; dns and ssl are defined in the wire format but rejected with 400 (issue #209 — see "Invalid request" below). Max 100 monitors per account. Duplicate URLs within the same account are rejected.
recipient_ids (issue #329) selects which recipients the new monitor is created with — see MonitorCreateInput. Omitted or null attaches the account's default recipients (recipients.is_default), unchanged from pre-#329 behavior. An explicit array (including []) attaches exactly that set instead: validated like PUT /monitors/{id}/recipients (positive ids, no duplicates — 400 before any write) and ownership-checked against the calling account (400 on a foreign or nonexistent id, before the monitor-limit and duplicate-URL checks, so a bad id is reported even for an account already at its cap).
recipients (issue #338) is recipient_ids's alternative form, letting each attached pair set its own down_delay_s at create time — see MonitorRecipients. Mutually exclusive with recipient_ids: specifying both is 400. recipients: null is 400 (unlike recipient_ids: null, which keeps its "attach defaults" meaning).
The dispatcher synchronously runs an immediate test check against the configured URL before returning, so the create response carries state.status of up or down instead of unknown. The check uses the same probe path as POST /api/v1/monitors/{id}/test. If the probe is unavailable, the kill switch is engaged, or the URL fails the dispatch-time SSRF guard (DNS rebind between validation and dispatch), the create still succeeds and state.status is unknown — the next scheduled tick will populate it.
Per-account scan heuristic: a sliding window (10 minutes by default; SCAN_WINDOW) tracks the (host, port) tuples of each newly-created monitor — and, identically, every PUT /api/v1/monitors/{monitorID} that changes url or type (issue #335; see that endpoint's description) — and branches on two signatures:
- Port-fan (≥6 distinct ports, by default — SCAN_PORTFAN_THRESHOLD — on ≤2 hosts, by default — SCAN_PORTFAN_HOSTS): scanner-shaped → account suspended (403), all monitors purged, security alert fired. A tcp monitor's port — already checked against the TCP allowlist below — counts toward a separate, wider ceiling, SCAN_PORTFAN_TCP_THRESHOLD (default 12, issue #331 — unset tracks the greater of 12 and the effective SCAN_PORTFAN_THRESHOLD); http/ping targets always trip at the stricter SCAN_PORTFAN_THRESHOLD (6), even mixed with tcp targets on the same host.
- Host-fan (≥8 distinct registrable domains, by default — SCAN_HOSTFAN_THRESHOLD — eTLD+1; IP literals count individually; subdomains of one site fold into a single domain): ambiguous — also matches an agent provisioning a real multi-service stack → rejected with 429 + Retry-After (seconds until the oldest entry leaves the window). Account is NOT suspended; retry after Retry-After seconds. The response always carries the actual limit and window enforced (X-RateLimit-Limit/X-RateLimit-Window headers, limit/ window_seconds body fields) — these defaults are examples, not hard-coded values a client should assume.
Subject to two independent per-account rate limits. A request consumes one token from each:
- Global cap: 200 requests/minute on any authed /api/v1/* route (envelope: account rate limit exceeded; retry in <N>s).
- Creation cap: 20 POST /api/v1/monitors per minute (envelope: monitor creation rate limit exceeded; retry in <N>s). Either rejection responds 429 with an integer Retry-After header.
Request
- Base URL: https://api.uptimemonitoring.com
- URL: https://api.uptimemonitoring.com/api/v1/monitors
- Auth: HTTP bearer
Request body
Example request
{
"maintenance": {
"start_time": "23:00",
"end_time": "03:00",
"timezone": "Europe/Lisbon"
}
}Response
Monitor created. state.status carries up or down from the immediate test check. unknown indicates a best-effort skip (probe unavailable, kill switch active, or SSRF rebind detected at dispatch time); the next scheduled tick populates it.
Soft-cap notice: when the post-insert per-account monitor count is in the 51..100 window, the response carries an additional notice object (code: soft_cap_reached). Creates at or below 50 produce a response with no notice field at all (omitempty). The 101st create returns 409 (see "Monitor limit reached").
Example response
{
"monitor": {
"name": "Production API",
"url": "https://api.example.com/health",
"interval_sec": 60,
"expected_status": "200",
"maintenance": {
"start_time": "23:00",
"end_time": "03:00",
"timezone": "Europe/Lisbon"
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.