Skip to content
Sign inDashboard

Errors and rate limits

Errors are RFC 9457 problem documents (application/problem+json) with a stable machine code. Match on code, not on title or detail.

{
"type": "https://opdns.io/problems/validation_failed",
"title": "Validation failed",
"status": 422,
"code": "validation_failed",
"errors": [{ "field": "settings.retention_days", "message": "must be 1 to 90" }],
"request_id": "…"
}

When you report a problem, include request_id. The full list of codes is the Problem schema in the reference.

Status Common codes
400 bad_request, body_too_large, bad_if_match, invalid_token, token_expired, token_used, invalid_cursor, bad_idempotency_key
401 unauthenticated, second_factor_required, invalid_recovery_code, node_revoked
403 insufficient_scope, session_required, csrf_rejected, reauth_required, mfa_enrolment_required, mfa_required, email_unverified
404 not_found (also for the resources of another organization)
409 ip_conflict, email_taken, idempotency_key_reused, idempotency_in_progress, profile_not_empty, profile_suspended, node_token_superseded
412 version_mismatch
422 validation_failed, unknown_list, too_many_rules, password_too_short, password_too_long, range_too_large, query_too_expensive
429 rate_limited, login_unlock_required, too_many_streams, too_many_reports, too_many_queries
501 not_implemented, shape_unsupported
502, 503, 504 502: node_error. 503: node_offline, node_busy, relay_unavailable, server_busy. 504: node_timeout, query_timeout

A new password (sign-up, change, reset, recovery) must have 10 to 256 Unicode code points. A shorter or longer password gets 422 password_too_short or password_too_long, with the password field in errors. When other fields are also invalid, the answer is validation_failed, and it lists all of them. There is no other password rule.

The API checks every JSON request body against its schema in the reference before the operation runs. These problems get 422 validation_failed, with one entry per field in errors:

  • A missing required field.
  • A wrong type.
  • A value outside an enum, or outside a length or range limit.
  • A malformed email address, UUID, date-time or IPv4 address.

The few sign-in operations that document no 422 answer 400 instead. Nested fields are named with dots and indexes, such as deny[2].pattern. A field that the schema does not have gets 400 bad_request. So does a body that is not JSON.

409 profile_suspended answers a change to a profile that opdns suspended. This covers its settings, rules, lists, linked IPs, devices, deletion and new nodes. Reads still work. The suspended field of the profile tells you in advance. See Suspended profiles.

Every profile resource returns its version as a strong ETag ("3"). Send it back as If-Match on a write. If someone changed the profile in between, the write fails with 412 version_mismatch, and nothing changes. To write unconditionally, leave out If-Match. Every successful write increments the version and publishes the whole profile to the resolvers.

Terminal window
curl -X PATCH https://api.opdns.io/v1/profiles/abc123 \
-H "Authorization: Bearer $OPDNS_TOKEN" \
-H 'If-Match: "3"' -H 'Content-Type: application/json' \
-d '{"settings":{"retention_days":7}}'

Every list endpoint uses cursor pagination. Send limit (default 50, at most 200). For the next page, also send cursor set to the next_cursor of the previous page. next_cursor is null on the last page. The order is stable, so rows created while you page are never repeated or skipped before the cursor. Cursors are opaque. A modified cursor gets 400 invalid_cursor.

Terminal window
curl -H "Authorization: Bearer $OPDNS_TOKEN" \
'https://api.opdns.io/v1/profiles?limit=100&cursor=…'

Log queries page the same way, with their own limit (at most 1,000 rows).

POST requests that create something (profiles, tokens, linked IPs, nodes, exports, list reports) accept an Idempotency-Key header. The key is any unique string, such as a UUID. If you repeat the request with the same key and the same body within 24 hours, the API replays the first successful answer with Idempotent-Replayed: true. It does not create a second resource. So a script can retry a request when it never received the answer.

Situation Answer
same key, same request, first one succeeded the first answer again, Idempotent-Replayed: true
same key, first one still running 409 idempotency_in_progress with Retry-After. Retry with the same key
same key, different request 409 idempotency_key_reused
first one failed nothing is stored. You can use the key again

Keys are per account.

GET /v1/profiles/{id}/logs and /analytics/{shape} answer a QueryResult: columns, rows, source, next_cursor and partial. source is clickhouse for the log database of the cloud, node for your self-hosted node, or none.

Log rows (tail and search) carry the stored columns (ts, source, pop, node, profile_id, device_id, device_name, client_ip, transport, qname, qtype, status, reason_list_id, reason_rule, rcode, dnssec_validated, cache_hit, latency_us, answer_ips) and four derived columns. The API computes the derived columns the same way for cloud and node results, whatever the version of the node:

Column Holds
reason the list name when a list decided, else the rule or operator text as stored (denylist: *.example.com, rewrite: =nas.home, legal_order LO-17). Empty when domain logging blanked a rule
reason_code list, rule, operator:<code> (legal_order, abuse, csam), rewrite, or none for allowed and failed queries
ede_code the Extended DNS Error that the client received: 15 for operator blocks, 17 for every other block, 0 otherwise (the EDE of a failed upstream is not recorded)
ede_text the EDE extra text: the reason of a block

The top_reasons analytics shape groups queries by what decided them: reason_code, list_id (for list only), reason and count, most frequent first. Without a status filter, it counts blocked and rewritten queries. A self-hosted node older than this shape answers 501 shape_unsupported.

The destinations shape groups allowed queries by answer address: ip, count, and since API 0.2.0 two more columns:

Column Holds
country the ISO 3166-1 alpha-2 code of the address, from the GeoIP database of the server. "" when unknown, when the address is not public, or when the deployment has no database
owner the company that owns the address: google, apple, meta, amazon, microsoft, or the CDNs cloudflare, akamai, fastly. "" for any other

The API adds both columns to answers that lack them (from a node older than this change). It also fills an empty country from its own database. So a relayed answer has countries even though nodes have none. When the license of the database asks for credit, geoip_attribution in GET /v1/meta holds the notice to show next to the countries. Where both columns come from: What ingest adds.

The top_owners shape counts queries by the company that they reached: owner and count, most first, ties by owner. The owner of a query is the owner of its name, from a curated list of domain suffixes (youtube.com belongs to Google). Otherwise, it is the owner of its first classified answer address. Queries with neither are left out. The shape has no default status filter. A node older than this shape answers 501 shape_unsupported.

The top_pops shape (API 0.5.0) counts queries by the PoP (a server location) that answered them: pop and count, most first, ties by pop. pop is the short id of the PoP (ams), or node for queries that a self-hosted node answered itself. Records without a PoP are left out. The default limit is 10, at most 100. There is no default status filter. A node older than this shape answers 501 shape_unsupported.

Terminal window
curl -H "Authorization: Bearer $OPDNS_TOKEN" \
'https://api.opdns.io/v1/profiles/abc123/analytics/top_pops?limit=20'

To name and place the ids, use GET /v1/pops (no authentication). It lists the PoP catalog of the deployment, sorted by id. Each entry has id, name (the label to show, the city), city, region (the subdivision code, when there is one), country (ISO 3166-1 alpha-2), lat and lon (WGS 84 degrees), status and servers. status follows what the servers of the PoP report every 30 seconds:

  • serving: every server in service answers.
  • degraded: some servers answer.
  • down: no server answers, or no server reported in the last 5 minutes.
  • planned: not in service yet.

health_updated_at is the time of the last report from a server of the PoP. Each server lists its own state: announced, withdrawn, or unknown when it did not report lately. The answer can be cached for 15 seconds (Cache-Control: public, max-age=15). A deployment without PoP locations answers an empty array.

[
{ "id": "ewr", "name": "Secaucus", "city": "Secaucus", "country": "US",
"region": "NJ", "lat": 40.777664, "lon": -74.071382, "status": "serving",
"health_updated_at": "2026-10-01T21:40:12Z",
"servers": [
{ "name": "pop-ewr-1", "state": "announced", "healthy": true,
"sessions": { "up": 2, "total": 2 }, "last_seen": "2026-10-01T21:40:12Z" },
{ "name": "pop-ewr-2", "state": "announced", "healthy": true,
"sessions": { "up": 2, "total": 2 }, "last_seen": "2026-10-01T21:40:05Z" }
] }
]

partial is true in two cases. In the first case, a node answered with fewer rows than asked (partial_reason timeout, near its query deadline, or overload). In the second case, the node of a self-hosted profile is between link sessions (node_reconnecting, no rows, and a tail keeps its cursor). The rows that are present are correct.

Every log and analytics query passes the same guardrails before any store is read. This is true when the log database of the cloud answers and when your self-hosted node answers.

Each shape covers at most a fixed time range:

Shapes Longest from..to
search, top_devices, destinations, top_pops (read every row of the range) 31 days
counts_by_status, timeline, top_domains, top_blocked, top_reasons, top_owners (read hourly totals) 400 days
tail (the newest rows under limit) no limit

A wider range gets 422 range_too_large, with from named in errors. A query without from is not refused. Its range starts that long before to (or now), so a bare search covers the last 31 days. The widest preset of the dashboard, 30 days, fits every shape. Cloud logs are kept at most 90 days in any case.

{
"type": "https://opdns.io/problems/range_too_large",
"status": 422,
"code": "range_too_large",
"detail": "search queries cover at most 31 days; narrow from and to",
"errors": [{ "field": "from", "message": "at most 31 days before to" }]
}

Queries draw on a budget per organization:

  • Two units per day of range for a query that reads raw rows (the 31-day shapes, and any shape filtered by more than time).
  • One unit per week of range for a query that reads hourly totals.
  • One unit for a tail.

The budget refills at 1,200 units a minute (about five 30-day loads of the Analytics page). At most four queries of an organization run at once. Another query waits up to five seconds for a slot. A query over budget, or still without a slot after five seconds, gets 429 too_many_queries with Retry-After. Retry-After is in seconds, and the body repeats it as retry_after. Wait that long and retry.

One cloud query can read at most 500 million rows and 2 GiB of memory. A query that needs more is stopped and gets 422 query_too_expensive. Narrow the range or add filters. A retry of the same query does not help.

These limits are the same on every plan today. They are counted per API server, not across the whole service.

GET /v1/profiles/{id}/logs/stream (scope logs:read) is the live tail as server-sent events, with the filters of a tail log query. The stream sends:

  • event: rows with id: <cursor>, and a query result with the new rows as data. The first event carries the latest rows (up to limit), unless you resume. Events are sent only when there are rows.
  • event: error with a problem as data: a failure while the stream runs. After a transient failure (node_offline, node_timeout, a 5xx), the stream continues. After any other failure, it ends.
  • event: partial with {"partial": true, "partial_reason": "node_reconnecting"}: a poll came back partial with no rows, because the node is reconnecting. This event is sent once until a complete poll. rows events carry their own partial flag.
  • A : heartbeat comment every 15 seconds. Each heartbeat checks your credential and the profile again. A revoked session or token, or a deleted profile, ends the stream.

To resume without gaps or repeats, reconnect with Last-Event-ID or with ?cursor= set to the last event id. The EventSource of browsers does this by itself. The server checks the log destination every second. It ends a stream after an hour, so reconnect then. An account can hold 4 streams at once per API server. Beyond that, the answer is 429 too_many_streams. The dashboard then falls back to polling GET /v1/profiles/{id}/logs?mode=tail with cursor.

Terminal window
curl -N -H "Authorization: Bearer $OPDNS_TOKEN" \
'https://api.opdns.io/v1/profiles/abc123/logs/stream?status=blocked'

The log destination of the profile answers log and analytics queries. For a self-hosted destination, the API relays the queries to the node. The node can be:

  • Offline: 503 node_offline with Retry-After.
  • Busy: 503 node_busy, at most 4 queries in flight per node.
  • Slow: 504 node_timeout, after 10 seconds.
  • Too old for a query shape: 501 shape_unsupported.

POST /v1/profiles/{id}/list-reports (scope profiles:write) reports a domain for the list list_id. kind is false_positive when the list blocks the domain by mistake, or false_negative when the list misses it. You can add an optional note of up to 500 characters. The answer is 202 with the id of the report. The domain is stored in lower case without a trailing dot, with the catalog version of the list at the time. An account can send 20 reports in 24 hours. The 21st report gets 429 too_many_reports with Retry-After.

GET on the same path (scope profiles:read) lists the reports of the profile, newest first. Each report has its status (open, accepted, rejected), the resolution_note of the maintainers and triage_due_at. triage_due_at is the target of the maintainers for an answer: two business days (Monday to Friday, UTC) after the report. When the maintainers accept or reject a report, the reporter gets an email with the outcome and their note. Accepting a report does not change a list by itself. See Report a wrong block or a miss.

Unauthenticated routes (sign-up, sign-in, the catalog, enrollment, DDNS) are limited per client network: an IPv6 /64 or an IPv4 address. Sign-in is also limited per /48 or /24. Over the limit, these routes answer 429 rate_limited with Retry-After (seconds, repeated as retry_after in the body).

Password sign-in has two more limits, counted on all servers together: 20 failed attempts on an address within an hour, or 10 wrong second-factor codes on an account. After either limit, POST /v1/auth/login answers 429 login_unlock_required, and the address gets a sign-in link by email. Send the token of the link as unlock_token with the password. Passkey sign-in does not have these limits. When the server is saturated, a route that checks a password can answer 503 server_busy with Retry-After.

Requests with an API token are limited per organization. Every token of every member counts against one budget: the API requests per minute of the plan (api_requests_per_minute in GET /v1/account/plan, and the number for each plan on the pricing page). The budget is counted in fixed one-minute windows, the same on every server that answers you. Dashboard sessions do not count.

Every response to a token says where you stand, with the fields of the IETF RateLimit header draft:

Header Value
RateLimit-Limit the requests per window of the plan
RateLimit-Remaining the requests left to the organization in this window
RateLimit-Reset the seconds until this window ends
RateLimit-Policy the policy, <limit>;w=60
RateLimit-Limit: 120
RateLimit-Remaining: 0
RateLimit-Reset: 23
RateLimit-Policy: 120;w=60
Retry-After: 23

Past the limit, the answer is 429 rate_limited with Retry-After (the same seconds as RateLimit-Reset). Wait that long and retry. Spread requests across the window, and do not send them in bursts. Give each script its own token, so that the audit log tells them apart. The scripts still share the budget.

POST /v1/client-errors (a session, or a token with account:read) stores a scrubbed error report from the dashboard. A report holds the message, stack, route, version and user agent, at most 32 KiB. An account can send 10 reports a minute. Reports are kept 30 days and are deleted with the account. You can turn off the reporting of the dashboard per browser (Error reports).