Replay protection site-replay-guards
Replay protection of one site: protected APIs need a one-time token or the app signature headers, otherwise the request is blocked or challenged; can be set for the site alone or restored to the scheme; part of WAF Enhanced.
Pick an endpoint to see its example call on the right.
Authentication
Send the X-API-Key header (create a key on the API Keys page; the key is shown only once at creation). An Authorization: Bearer token obtained by logging in also works.
X-API-Key
Authentication failures return 401; forbidden returns 403 (code such as insufficient_scope).
Conventions
Paging uses page (from 1) and page_size; sort with sort=field or sort=-field.
Times are RFC 3339 (UTC); amounts are in cents.
Writes return 200/201/204 on success; duplicates of a unique key return 409.
/api/v2/site-replay-guards/{site_id}Get site replay protection settings
Authentication: User (some parameters admin only)
/api/v2/site-replay-guards/{site_id}Set site replay protection
Authentication: User (some parameters admin only)
Request body application/json
| Field | Type | Description |
|---|---|---|
action | ReplayGuardAction | Without a token or on replay: block = 403; challenge = JS challenge. Omitted = block. |
app_salt | string | Signing salt (app key, 32-byte hex); with app_sign on but no salt, signed headers are never accepted. |
app_sign | boolean | App signature check - requests carrying the signature headers are checked by signature, no token needed. |
bind_ip | boolean | Also bind the token to the client IP (a new IP invalidates it). |
enabledRequired | boolean | Whether enabled. |
expected_updated_at | string | Optimistic lock - the updated_at as the caller read it (when null, i.e. never set, use 1970-01-01T00:00:00Z). If it differs from the stored one, 409 stale_version is returned and nothing is saved; omit to skip the check. |
methods | ReplayGuardMethod[] | Protected methods; omitted = POST/PUT/PATCH/DELETE. |
paths | ReplayGuardPath[] | Protected API paths, at most 64; empty = nothing protected. |
ttl_s | integer | Token lifetime in seconds, also used for signed-header timestamps; omitted = 120. |
/api/v2/site-replay-guards/{site_id}Restore site replay protection to the scheme
Authentication: User (some parameters admin only)
Replay protection object
| Field | Type | Description |
|---|---|---|
action | ReplayGuardAction | Without a token or on replay: block = 403; challenge = JS challenge. Omitted = block. |
app_salt | string | Signing salt (app key, 32-byte hex); with app_sign on but no salt, signed headers are never accepted. |
app_sign | boolean | App signature check - requests carrying the signature headers are checked by signature, no token needed. |
bind_ip | boolean | Also bind the token to the client IP (a new IP invalidates it). |
enabled | boolean | Whether enabled. |
expected_updated_at | string | Optimistic lock - the updated_at as the caller read it (when null, i.e. never set, use 1970-01-01T00:00:00Z). If it differs from the stored one, 409 stale_version is returned and nothing is saved; omit to skip the check. |
gate | string | WAF Enhanced status of the site's tenant: full = editable; readonly = expired but within the read-only buffer (License.readonly_days, 7 days by default), still in effect but read-only; basic = not subscribed or past the buffer, not in effect and settings kept. |
gate_expired_at | string | Administrator responses with gate_reason=expired only - when the platform WAF Enhanced license expired; not present in tenant responses. |
gate_owner | WafGateOwner | The owner of the site, in administrator responses only; tenant responses carry no one else's information. |
gate_packages | string[] | Administrator responses only - names of the owner's unexpired packages (at most 20); not present in tenant responses. |
gate_reason | WafGateReason | Why WAF Enhanced (waf_enhanced) is not in effect; absent when gate is full or readonly. package = the platform is licensed but the owner has no unexpired package that includes WAF Enhanced; license = the platform has not enabled it (never licensed, revoked by the provider, or the license was disabled); expired = the platform license has expired and its read-only buffer period (License.readonly_days, default 7 days) has passed, so it fell back to basic. |
methods | ReplayGuardMethod[] | Protected methods; omitted = POST/PUT/PATCH/DELETE. |
paths | ReplayGuardPath[] | Protected API paths, at most 64; empty = nothing protected. |
site_id | integer | Site ID |
source | ProtectSiteSource | Where the site's setting comes from: scheme = follows the scheme (changes when the scheme is saved); custom = set for this site alone (including turned off and rows migrated from before). |
ttl_s | integer | Token lifetime in seconds, also used for signed-header timestamps; omitted = 120. |
updated_at | string | Version (null if never set); use expected_updated_at on update. |
Responses and errors
Success returns the resource JSON directly (HTTP 2xx); failures return application/problem+json (code, detail, plus errors on validation failures); lists carry items + total.
{
"id": 1,
"name": "example"
}{
"items": [
{
"id": 1
}
],
"page": 1,
"page_size": 20,
"total": 1
}{
"code": "validation_failed",
"detail": "Invalid request parameters",
"errors": [
{
"code": "required",
"field": "/name",
"message": "name is required"
}
],
"request_id": "0123456789abcdef",
"status": 422,
"title": "Unprocessable Entity",
"type": "about:blank"
}