Get Firewall Policy

GET /v1/firewall/policies/{uuid}

Read the full policy record including its conditions array. Use this to inspect a policy's logic before editing or to render the conditions editor in a dashboard.

Path parameters

uuid string (uuid) Req
The policy's uuid (= its id) from /firewall/policies.

Response (200 OK)

The policy object, in the same shape as a list entry (id, uuid, user_uuid, account_uuid, name, description, action, priority, enabled, created_at, updated_at), with its conditions. Its match statistics are the ones its list row shows, over the same 7-day window: hit_count, and last_matched / hits_daily (both omitted when the policy hasn't matched in the window). Best-effort, as on the list: 0 and omitted when the stats can't be read.

conditions array?
All conditions on this policy; omitted when the policy has none (it then matches every request). Each: {id, uuid, policy_id, policy_uuid, condition_type, operator, condition_value, logical_operator, created_at} (id = uuid, policy_id = policy_uuid). condition_type is one of source_ip, country, asn, browser, user_agent, endpoint, path, method, header, cookie, protocol, port. operator is one of equals, contains, starts_with, ends_with, regex, in, not_in, exists, not_exists (the set valid for a given type is constrained — see create). logical_operator is the outgoing connector to the next condition: AND or OR.

Deprecated: until the sunset this response also carries the legacy integer user_id and account_id fields. Don't use them; read user_uuid and account_uuid.

Errors

401 Unauthorized
Missing auth.
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" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") policy = client.firewall.get_policy("019c32cb-35d7-786f-b2c5-d108951e23d8") for c in policy["conditions"]: print(f" {c['condition_type']} {c['operator']} {c['condition_value']}")
Response — 200 OK
{ "id": "019c32cb-35d7-786f-b2c5-d108951e23d8", "uuid": "019c32cb-35d7-786f-b2c5-d108951e23d8", "user_uuid": "019a52c2-ca1e-78ba-ab5c-50362cc29134", "account_uuid": "019a68b9-1a79-7820-a884-41f554aba6bd", "name": "block-known-bad-ips", "action": "block", "priority": 10, "enabled": true, "conditions": [ {"id": "019c4790-e565-733a-8f1b-52bc76befe65", "uuid": "019c4790-e565-733a-8f1b-52bc76befe65", "policy_id": "019c32cb-35d7-786f-b2c5-d108951e23d8", "policy_uuid": "019c32cb-35d7-786f-b2c5-d108951e23d8", "condition_type": "source_ip", "operator": "in", "condition_value": "203.0.113.0/24", "logical_operator": "AND", "created_at": "2026-04-29T13:00:00Z"}, {"id": "019c512c-72dc-7a77-b3c3-4429bde47f9a", "uuid": "019c512c-72dc-7a77-b3c3-4429bde47f9a", "policy_id": "019c32cb-35d7-786f-b2c5-d108951e23d8", "policy_uuid": "019c32cb-35d7-786f-b2c5-d108951e23d8", "condition_type": "protocol", "operator": "equals", "condition_value": "tcp", "logical_operator": "AND", "created_at": "2026-04-29T13:00:00Z"} ], "hit_count": 42, "last_matched": "2026-04-29T12:58:10Z", "hits_daily": [3, 5, 8, 4, 6, 9, 7], "created_at": "2026-04-29T13:00:00Z", "updated_at": "2026-04-29T13:00:00Z" }
Was this helpful?
On this page
Get Firewall Policy
Was this helpful?