Traffic Policy Rule Types
Catalog of every rule type the platform supports, including each type's expected config JSON schema, available phases, and plan-entitlement requirement. Used by the dashboard's per-rule editor to render the right form fields and validate input client-side.
The catalog is authoritative and always current — it includes the API-gateway rule types cors, set-vars, waf and bot-management (request phase) and replace-body and compress-response (response phase), alongside the classics (restrict-ips, rate-limit, jwt-validation, redirect, …). See Add Rule for per-type config examples.
Schemas are shipped as JSON Schema (draft 7). Render forms with rjsf, AJV-based validators, or any JSON-Schema-aware tool.
Response (200 OK)
JSON object with one entry per rule type:
items array
Catalog entries.
items[].rule_type string
Stable slug. Pass directly as
rule_type when creating a rule.items[].name, description string
Human-readable label and one-paragraph description.
items[].phases string[]
Phases this rule type can run in (subset of
on_tcp_connect, on_udp_connect, on_http_request, on_http_response).items[].config_schema object
JSON Schema (draft 7) for the
config object the rule expects. Validate against this client-side before submitting to /rules.items[].entitlement string
Entitlement key required to use this rule type. Cross-reference with /account/entitlements.
items[].docs_url string
Link to the in-depth docs page for this rule type.
Request
curl "https://api.ngris.com/v1/traffic-policy/rule-types" \
-H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris
client = Ngris(api_key="<your_api_key>")
catalog = client._get_raw("/traffic-policy/rule-types")
for r in catalog["items"]:
print(f"{r['rule_type']}: {r['name']} (phases: {', '.join(r['phases'])})")
Response — 200 OK (excerpt)
{
"items": [
{
"rule_type": "rate_limit",
"name": "Rate Limit",
"description": "Cap requests per time window keyed by IP, path, header, or custom expression.",
"phases": ["on_http_request"],
"config_schema": {
"type": "object",
"required": ["requests", "window_seconds"],
"properties": {
"requests": {"type": "integer", "minimum": 1},
"window_seconds": {"type": "integer", "minimum": 1},
"key": {"type": "string", "enum": ["client_ip", "path", "header"]}
}
},
"entitlement": "traffic_rule:rate_limit",
"docs_url": "/docs/traffic-policies/rate-limit"
}
]
}