Skip to content

Errors

The API reports failures with a standard HTTP status code and a small JSON body.

Every JSON error has one field, error, holding a human-readable string:

{ "error": "monitor not found" }

The message is for people and logs. It can change between releases, so branch on the HTTP status code, not on the message text.

A few errors add a boolean marker next to error so a client can tell them apart from other errors with the same status:

MarkerStatusMeaning
"upgrade_required": true403The feature needs a paid plan. See Plan limits.
"staff_readonly": true403A read-only support session tried to change something. Customers do not see this one.

A few handlers also add context fields, for example retry_after (seconds) on the 429 from POST /api/v1/auth/resend-verification.

One response is not JSON: the 429 from a rate-limited endpoint has a text/plain body (Too Many Requests). Check the status code before parsing the body.

import time
import requests
def call(method, url, **kwargs):
for attempt in range(3):
r = requests.request(method, url, timeout=30, **kwargs)
if r.status_code == 429:
time.sleep(int(r.headers.get("Retry-After", "60")))
continue
if r.ok:
return r.json() if r.content else None
try:
message = r.json()["error"]
except (ValueError, KeyError, TypeError):
message = r.text
raise RuntimeError(f"{r.status_code}: {message}")
raise RuntimeError("rate limited after 3 attempts")
StatusMeaningTypical causes
400 Bad RequestThe request could not be used.Invalid JSON, a body over 1 MiB, a missing required field, an invalid value, a URL that resolves to a private address.
401 UnauthorizedNo valid credentials.Missing Authorization header, a header without the Bearer prefix, an unknown or deleted API key, an expired session.
403 ForbiddenCredentials are valid but not allowed to do this.The API key lacks a scope, the key is read-only, the route needs the owner or admin role, a plan gate or plan limit, MFA enrollment required, account disabled.
404 Not FoundThe resource does not exist or belongs to another organization.YipYap answers 404, not 403, for another organization’s resources, so it never confirms that an ID exists.
409 ConflictThe request conflicts with current state.For example, an email that is already in use, or an alert that is already linked to an incident.
413 Payload Too LargeThe body is over an endpoint cap.CloudEvents ingest over 4 MiB or over 256 events in a batch.
422 Unprocessable EntityThe request is valid but cannot be applied.A CloudEvent type the org does not accept, an event for a disabled monitor.
429 Too Many RequestsRate limit or concurrency cap reached.See Rate Limits. Wait for Retry-After seconds.
500 Internal Server ErrorThe server failed.Retry with backoff. If it persists, contact support with the time, method and path.
501 Not ImplementedThe deployment’s store does not support this resource.Monitor groups or custom states on a store without them.
502 Bad GatewayA downstream delivery failed.POST /api/v1/notification-channels/{id}/test when the provider rejects the test message.
503 Service UnavailableA dependency is not configured or not reachable.Retry with backoff.

A plan can block a request in two ways. Both return 403.

Feature gates. The endpoint or channel type needs a paid plan, and a Free organization calls it. The body carries the upgrade_required marker:

{ "error": "this feature requires a paid plan", "upgrade_required": true }

This applies to SSO connections, status pages, incidents, the OpenTelemetry integration, CloudEvents poll and stream, and the Knative source config. Creating an SMS, voice, Telegram or CloudEvents HTTP channel on Free returns the same shape with a message naming the channel, for example "SMS/voice notifications require a paid plan".

Resource limits. The organization has reached its plan’s count for a resource (monitors, notification channels, escalation policies, teams, schedules, status pages, members) or asked for a check interval below its plan’s minimum. The body is a plain error with no marker:

{ "error": "monitor limit reached (5). Upgrade your plan to add more" }

Self-hosted YipYap FOSS has no plans, so there are no feature gates and no plan limits. The server operator can set optional caps per organization with YIPYAP_MAX_MONITORS_PER_ORG, YIPYAP_MAX_NOTIFICATION_CHANNELS_PER_ORG, YIPYAP_MAX_ESCALATION_POLICIES, YIPYAP_MAX_MEMBERS and YIPYAP_MIN_CHECK_INTERVAL_SECONDS. A request past a cap gets 403 with a plain error body that names the variable.

  1. Branch on the status code. Messages are for people and can change.
  2. A 403 with an API key is usually scope or role. The message says which: api key missing required scope: monitors, api key is read-only, or insufficient permissions (the route needs the owner or admin role, which an API key never has). See Authentication.
  3. Rate-limit headers are authoritative. Read Retry-After on a 429 instead of guessing.
  4. Private-address blocks are intentional. A monitor target or channel URL that resolves to a private, loopback, link-local or metadata address is rejected with 400. On YipYap FOSS, YIPYAP_ALLOW_PRIVATE_TARGETS (on by default) lets monitors and notification channels reach private addresses.