List Firewall Conditions

GET /v1/firewall/policies/{id}/conditions

List the conditions attached to a firewall policy. A policy fires when all its conditions match (AND semantics). For OR-style logic, create multiple policies that share an action.

Path parameters

id string (uuid) Req
Policy UUID.

Response (200 OK)

JSON array of conditions:

id string (uuid)
Condition UUID.
type string
Match category — one of: source_ip (IP/CIDR), country (ISO 3166-1 alpha-2), asn (e.g. AS15169), browser, user_agent, endpoint (host), path, method (HTTP verb), header, cookie, protocol (http / tcp / udp), port (1–65535). country / asn are derived from the source IP. Case-insensitive; stored lowercased.
operator string
Comparison. Per type: source_ip / protocol / port / methodequals / in / not_in; path / endpoint additionally allow contains / starts_with / ends_with / regex; country / asn additionally allow exists / not_exists; header / cookie / user_agent / browser allow all of those plus exists / not_exists (those are the only fields that can be absent). Case-insensitive; stored lowercased.
key string
For type: "header": header name. Otherwise empty.
value string
Pattern, IP, CIDR, country code, etc. Format depends on type + operator.
negate boolean
true inverts the match (NOT).
created_at, updated_at datetime
RFC 3339 UTC.

Errors

401 Unauthorized
Missing auth.
404 Not Found
Policy doesn't exist.
Request
curl "https://api.ngris.com/v1/firewall/policies/abc-123/conditions" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") for c in client.firewall.list_conditions("abc-123"): print(f" {c['type']} {c['operator']} {c['value']!r}")
Response — 200 OK
[ {"id": "cond-1", "type": "country", "operator": "in", "value": "RU,KP,IR", "negate": false}, {"id": "cond-2", "type": "path", "operator": "starts_with", "value": "/api/admin", "negate": false} ]
Iris