Get Traffic Policy

GET /v1/endpoints/{uuid}/policies/{policy_uuid}

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

Path parameters

uuid string (uuid) Req
The endpoint's uuid from /endpoints.
policy_uuid string (uuid) Req
The policy's uuid from the policy list. Resolved under this endpoint only.

Deprecated: the legacy integer id is still accepted in the path until the sunset, answered with Deprecation and Sunset headers. Use the uuid.

Response (200 OK)

Same shape as list entries plus:

rules array
All rules attached to this policy, ordered by priority; omitted when the policy has no rules. Each rule has uuid, policy_uuid, phase, rule_type, name, expression (CEL condition — omitted when the rule has none, so it runs on every request of its phase), config (rule-type-specific JSON), priority, enabled, created_at, updated_at. A verify-webhook or jwt-validation rule's config.secret is write-only: a saved secret reads "****", never the value (an empty one stays empty). To keep it, send **** back on a rule update.

Deprecated: until the sunset this response also carries the legacy integer id and *_id fields. Don't use them; read uuid and the *_uuid fields.

Errors

400 Bad Request
An integer policy id after the sunset (integer_id_unsupported).
401 Unauthorized
Missing auth.
404 Not Found
Endpoint or policy doesn't exist (or the policy doesn't belong to this endpoint: Policy not found).
Request
curl "https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/policies/019b74e7-6fe8-7784-9d8a-9b7f9cb99a89" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") policy = client.traffic_policies.get("019bb1e4-e785-77d2-9966-c3cff31d0a0e", "019b74e7-6fe8-7784-9d8a-9b7f9cb99a89") for rule in policy["rules"]: print(f" [{rule['priority']}] {rule['rule_type']}: {rule['name']}")
Response — 200 OK
{ "uuid": "019b74e7-6fe8-7784-9d8a-9b7f9cb99a89", "endpoint_uuid": "019bb1e4-e785-77d2-9966-c3cff31d0a0e", "name": "rate-limit", "description": "100 req/sec per client IP", "enabled": true, "priority": 10, "created_at": "2026-04-01T00:00:00Z", "updated_at": "2026-04-01T00:00:00Z", "rules": [ { "uuid": "019b7fe5-336a-7789-aeab-182ddfcd5711", "policy_uuid": "019b74e7-6fe8-7784-9d8a-9b7f9cb99a89", "phase": "on_http_request", "rule_type": "rate-limit", "name": "100rps", "config": {"limit": 100, "window": 1, "scope": "ip"}, "priority": 0, "enabled": true, "created_at": "2026-04-01T00:00:00Z", "updated_at": "2026-04-01T00:00:00Z" } ] }
Was this helpful?
On this page
Get Traffic Policy
Was this helpful?