List Firewall Conditions
List the conditions of a firewall policy, in the order they are evaluated. Each condition's logical_operator (AND or OR) joins it to the next one, and the chain is read left to right with no precedence: cond1 [op1] cond2 [op2] cond3 …. A policy with no conditions matches every request.
Path parameters
uuid string (uuid) Req
The policy's
uuid from /firewall/policies.Query parameters
page int
1-based page number. Without it the response holds every condition of the policy and no
total / page / page_size.page_size int
Conditions per page when
page is set. Default 15, max 200.Response (200 OK)
A JSON object {"conditions": [...]}, plus total, page and page_size when page was sent. conditions is [] when the policy has none. Each condition:
uuid string (uuid)
The condition's uuid. Used in /conditions/{condition_uuid}.
policy_uuid string (uuid)
The parent policy's uuid.
condition_type string
What the condition matches, lowercase:
source_ip (IP or CIDR), country (ISO 3166-1 alpha-2), asn, browser, user_agent, endpoint, path, method (HTTP verb), header, cookie, protocol (http / tcp / udp) or port (1–65535). country and asn are derived from the source IP. Sent as type when you create or update a condition.operator string
The comparison, lowercase. Per type:
source_ip / method / protocol / port take equals / in / not_in; country / asn add exists / not_exists; path / endpoint take equals / in / not_in / contains / starts_with / ends_with / regex; header / cookie / user_agent / browser take all of those plus exists / not_exists.condition_value string
The value compared, as stored: country codes and HTTP methods uppercase, protocols lowercase, ASNs with the
AS prefix (AS15169), and an in / not_in list joined with ", " ("RU, KP, IR"). An endpoint condition with equals / in / not_in names endpoints by uuid. Empty for exists / not_exists. Sent as value when you create or update a condition.logical_operator string
AND or OR: joins this condition to the next one. On the last condition it has no effect.created_at datetime
RFC 3339.
id, policy_id string (uuid)
The same values as
uuid and policy_uuid (firewall ids are uuid strings). Read uuid and policy_uuid.Errors
401 Unauthorized
Missing auth.
403 Forbidden
Your role can't read the firewall.
404 Not Found
Policy doesn't exist, belongs to another account, or the path segment isn't a uuid.
Request
curl "https://api.ngris.com/v1/firewall/policies/019c32cb-35d7-786f-b2c5-d108951e23d8/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("019c32cb-35d7-786f-b2c5-d108951e23d8"):
print(f" {c['condition_type']} {c['operator']} {c['condition_value']!r} {c['logical_operator']}")
Response — 200 OK
{
"conditions": [
{
"id": "019c4790-e565-733a-8f1b-52bc76befe65",
"policy_id": "019c32cb-35d7-786f-b2c5-d108951e23d8",
"uuid": "019c4790-e565-733a-8f1b-52bc76befe65",
"policy_uuid": "019c32cb-35d7-786f-b2c5-d108951e23d8",
"condition_type": "country",
"operator": "in",
"condition_value": "RU, KP, IR",
"logical_operator": "AND",
"created_at": "2026-04-29T13:00:00Z"
},
{
"id": "019c512c-72dc-7a77-b3c3-4429bde47f9a",
"policy_id": "019c32cb-35d7-786f-b2c5-d108951e23d8",
"uuid": "019c512c-72dc-7a77-b3c3-4429bde47f9a",
"policy_uuid": "019c32cb-35d7-786f-b2c5-d108951e23d8",
"condition_type": "path",
"operator": "starts_with",
"condition_value": "/api/admin",
"logical_operator": "AND",
"created_at": "2026-04-29T13:01:00Z"
}
]
}
Was this helpful?