Skip to content
nsin docs

Change the automatic attack switches

PUT
/domains/{domain}/attack-settings
curl --request PUT \
--url https://api.nsin.ir/domains/example.com/attack-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "auto_under_attack": true }'

Send any of the switches; a missing one keeps its value.

auto_attack_rules off: attacks are still detected, recorded and reported, but no rule is added. Rules already added are left as they are.

auto_under_attack on: when an attack is detected and no rule is blocking it, Under Attack Mode switches on by itself (with a 6-hour timer) and off again when the attack ends or is marked as not an attack. A mode you switched on yourself is never switched off. Needs a plan with Under Attack Mode; otherwise the switch has no effect.

behaviour_detection off: changes in how the domain’s traffic behaves (not how much of it there is) are no longer recorded as attacks. Floods are still detected.

Requires domain.settings.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com
Media type application/json
object
auto_attack_rules

Add a dry-run rule when an attack is detected (default true).

boolean
auto_under_attack

Switch Under Attack Mode on by itself during an attack nothing blocks, and off when it ends (default false).

boolean
behaviour_detection

Record an attack when the traffic suddenly behaves differently, even at normal volume (default true). Rules still need auto_attack_rules.

boolean
detection_ready

False while the domain is younger than 3 days: automatic detection needs 3 days of normal traffic first. Ignored in PUT.

boolean
Example
{
"auto_under_attack": true
}

The new switch.

Media type application/json
object
auto_attack_rules

Add a dry-run rule when an attack is detected (default true).

boolean
auto_under_attack

Switch Under Attack Mode on by itself during an attack nothing blocks, and off when it ends (default false).

boolean
behaviour_detection

Record an attack when the traffic suddenly behaves differently, even at normal volume (default true). Rules still need auto_attack_rules.

boolean
detection_ready

False while the domain is younger than 3 days: automatic detection needs 3 days of normal traffic first. Ignored in PUT.

boolean
Example generated
{
"auto_attack_rules": true,
"auto_under_attack": true,
"behaviour_detection": true
}

None of auto_attack_rules, auto_under_attack or behaviour_detection given as a boolean.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

The key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}