Get the automatic attack switches
const url = 'https://api.nsin.ir/domains/example.com/attack-settings';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.nsin.ir/domains/example.com/attack-settings \ --header 'Authorization: Bearer <token>'Whether automatic attack detection may add a blocking rule (in dry run)
when it detects an attack on this domain (on by default), whether
Under Attack Mode switches on by itself during an attack nothing
blocks (off by default), and whether behaviour detection watches the
domain (on by default). Requires domain.view.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comResponses
Section titled “ Responses ”The switch.
object
Add a dry-run rule when an attack is detected (default true).
Switch Under Attack Mode on by itself during an attack nothing blocks, and off when it ends (default false).
Record an attack when the traffic suddenly behaves differently, even at normal volume (default true). Rules still need auto_attack_rules.
False while the domain is younger than 3 days: automatic detection needs 3 days of normal traffic first. Ignored in PUT.
Example generated
{ "auto_attack_rules": true, "auto_under_attack": true, "behaviour_detection": true}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid 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.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}