Errors

The error format of the OpenWAF API, its HTTP statuses and every stable error code with its meaning.

On this page

Errors answer an HTTP status and a JSON body:

{
  "error": {
    "code": "version_conflict",
    "message": "the configuration changed: the current version is 13"
  },
  "current_version": 13
}
FieldMeaning
error.codeStable code: use it in your code.
error.messageHuman explanation; its wording may change.
error.fieldField that failed validation, when there is one (e.g. ttl, records[3].content).

Some codes add fields next to error: current_version (version_conflict), hostnames (missing_certs), plan (merge_not_equivalent).

HTTP statuses

StatusMeaning
200, 201Success. With dry_run=1, 200 carries the plan of the change.
204Success without a body.
400Malformed request: invalid JSON, unknown field, invalid query parameter.
401Missing, invalid, expired or revoked token.
403The token's role or limits do not allow the operation.
404The resource does not exist or the token cannot see it.
409The current state does not allow the change.
412If-Match does not match the current version.
413The body is too large.
422Validation error or missing change reason.
428The operation requires If-Match.
429Too many requests: wait the seconds in Retry-After.
502, 503A dependency did not answer or the feature is not available: retry later.

Error codes

CodeStatusDescription
bad_request400Malformed request: invalid JSON, unknown field or invalid parameter.
unauthorized401Missing, invalid, expired or revoked token.
forbidden403The role or the limits of the token do not allow the operation.
token_scope403A cache-purge-only token called another route.
feature_disabled403The feature (egress) is not enabled for the organization.
zone_limit403The organization has reached its zone limit.
org_suspended403The organization is suspended; writes are refused.
org_pending_approval403The organization is waiting for approval; writes are refused.
not_found404The resource does not exist or the token cannot see it.
host_not_in_zone404The name is neither the zone nor below it.
conflict409The current state does not allow the change (e.g. a disabled zone, the last owner, a duplicate name).
zone_exists409The domain is already added.
zone_overlaps409The domain is a parent or a subdomain of a zone of another organization or another client.
zone_not_active409The zone is not active.
zone_not_external409The operation is only for external zones.
zone_merged409The zone is merged into another one and is read-only until it is unmerged.
merge_not_equivalent409The merge would change how some name is served; the body carries the plan.
merge_not_reversible409The zone is not merged or its parent changed since the merge.
missing_certs409Some sites would be left without a valid certificate; the body lists the hostnames.
already_member409The person is already a member of the organization.
owner_of_zones409The change would leave zones without an owner.
client_has_zones409The client still has zones; move or delete them first.
host_taken409The name is used by another organization.
target_in_use409An egress agent still allows the target.
version_conflict412If-Match does not match the current version; the body carries current_version.
too_large413The body or the file is too large.
invalid422Validation error; field names the field.
reason_required422The X-Change-Reason header is missing or invalid.
if_match_required428The operation requires If-Match.
rate_limited429Too many requests; wait the seconds in Retry-After.
too_many_streams429Too many event streams open in the organization.
dns_backend502The DNS service rejected the change; retry later.
dns_unavailable502The public DNS did not answer.
credential_store502The credential store refused the write; retry later.
unavailable503The feature is not available right now; retry later.
busy503Too many checks in progress; retry in a few seconds.
internal500Unexpected error; retry, and contact [email protected] if it persists.

Last updated:

↑↓ to navigate↵ to openesc to close