nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Domains

Get Under Attack Mode

gethttps://api.nsin.ir/domains/{domain}/under-attack

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

Whether Under Attack Mode is on for the domain, since when, when it switches itself off, its bypass paths, and whether the domain's plan includes it (allowed). Requires domain.view.

Path parameters

  • domainstringrequiredpath

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

Responses

200The domain's Under Attack Mode state.

Content type: application/json

  • enabledboolean
  • bypass_pathsarray of string

    Paths never challenged. Kept while the mode is off, for next time.

  • bypass_ipsarray of string

    Client IPs, CIDRs or ranges never challenged. Kept while the mode is off.

  • bypass_hostsarray of string

    Hosts (wildcard patterns) never challenged. Kept while the mode is off.

  • sincestring | null (date-time)

    When the mode was switched on. Null when off.

  • untilstring | null (date-time)

    When the mode switches itself off. Null when off or with no timer.

  • allowedboolean

    The domain's plan includes Under Attack Mode (under_attack_allowed).

json
{
  "enabled": true,
  "bypass_paths": [
    "string"
  ],
  "bypass_ips": [
    "string"
  ],
  "bypass_hosts": [
    "string"
  ],
  "since": "2026-01-01T00:00:00Z",
  "until": "2026-01-01T00:00:00Z",
  "allowed": true
}
401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
429The key exceeded its request budget (300 requests per minute by default).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "rate limit exceeded"
}

Example request

bash
curl -X GET "https://api.nsin.ir/domains/example.com/under-attack" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc