Skip to main content

API

The NNumbers WAF has a REST API documented in OpenAPI. It is the same API the Console uses: everything you do on screen can be done by a call, with the same permission and the same per-organization isolation.

Overview​

ItemHow it works
StyleREST, JSON body, snake_case fields
IdentifiersUUID version 7, as text
Dates and timesRFC 3339, in UTC
DocumentationOpenAPI specification published with the product
ScopeAlways the organization of your session

The Console is the recommended way to start: it shows the state of each step and avoids mistakes when assembling a call. The API is for automation — creating domains in bulk, syncing the policy with your provisioning, pulling events into your SIEM.

Authentication​

Authentication happens through the Console: you obtain the credential from your NNumbers Console access and use it in the calls. There is no WAF-specific username and password, and the API does not accept a credential from another organization.

The organization comes from the credential, never from the body, the query or a call header. A resource from another organization answers 404, not 403: its existence is not revealed.

Permissions​

Each operation requires a permission, consistent with the Console roles:

PermissionCovers
domains.readReading domains, verification, state and origin
domains.manageCreating, changing and removing domain, origin and verification
protection.manageActivating and deactivating protection
policies.readReading policies, rules, exceptions and revisions
policies.manageCreating and changing policy and rules
exceptions.manageCreating and removing exceptions
events.readReading events
metrics.readReading overview and metrics

A call without the required permission answers a scope error, with the correlation identifier to take to support.

Pagination​

Lists use a cursor:

ParameterValue
limitFrom 1 to 200; default 50
cursorOpaque value returned in the previous response

The response carries the items and the next cursor:

{
"items": [],
"next_cursor": "opaque"
}

When next_cursor is null, the list ended. Do not build a cursor yourself and do not store a position by page number: the cursor is opaque and may change shape.

Idempotency​

Every call that creates, changes or removes requires the Idempotency-Key header, with 1 to 128 characters.

SituationResponse
First call with the keyOperation executed
Retry with the same key and the same bodyThe same response as the first, flagged as replayed
Retry with the same key and a different bodyIdempotency conflict
Key already expiredThe key is discarded after 24 hours

Use one key per intended change, generated once and reused on retries. That is what prevents a duplicate domain when the network fails midway.

Changes also accept version control: the resource has an integer version, and the call may require the version to stay the same. If someone else changed it first, the response is a version conflict, not a silent overwrite.

Errors​

The error always has the same shape:

{
"error": {
"code": "validation_failed",
"message": "Readable text about what failed",
"correlation_id": "identifier of the call"
}
}
CodeWhen it happens
unauthorizedMissing or invalid credential
forbidden_scopeValid credential without the operation permission
not_foundResource does not exist in your organization
validation_failedInvalid body or parameter
conflictConflict with the current state
version_conflictThe required version is no longer current
idempotency_conflictSame idempotency key with a different body
hostname_unavailableHostname already registered by another organization
invalid_state_transitionThe step is not valid in the domain current state
verification_failedOwnership verification did not pass
origin_rejectedOrigin refused by the address or port rules
policy_in_usePolicy still used by a domain
payload_too_largeBody above the API limit
rate_limitedCalls above the API limit
dependency_unavailableService temporarily unavailable; retry later

Keep the correlation_id of every failure: it links the call to the record on the NNumbers side without reproducing the error.

Long-running operations​

Verifying, activating, deactivating, removing and applying a policy are operations that do not finish in the same response. The call answers with the resource and the current state, and you follow it through the domain state — the same states the Console shows.

Next steps​