Update Routing Rule
Edit a routing rule. The body uses the same shape as create — the rule is replaced wholesale (the platform doesn't merge); pass the full state you want, including the conditions array.
Changes take effect on the next request — there's no caching window. Use enabled: false if you want to suspend a rule without losing its config.
Path parameters
uuid string (uuid) Req
Endpoint UUID.
rule_id int64 Req
Numeric rule ID.
Request body
Same fields as create: name, priority, target_agent_id / target_agent_tags, enabled, conditions. The whole rule is replaced — passing only some fields zeroes the rest.
Response (200 OK)
The updated rule, same shape as a list entry.
Errors
400 Bad Request
Invalid JSON, non-numeric
rule_id, or empty conditions.401 Unauthorized
Missing auth.
403 Forbidden
Plan doesn't include the
endpoint_routing_rules entitlement.404 Not Found
Endpoint or rule doesn't exist (or doesn't belong to the calling user).
500
Database error during update.
Request
curl -X PUT "https://api.ngris.com/v1/endpoints/<uuid>/routing-rules/17" \
-H "X-API-KEY: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "canary-25pct",
"priority": 5,
"target_agent_tags": "canary,v2",
"enabled": true,
"conditions": [
{"condition_type": "header", "condition_key": "X-Canary", "pattern": "true"}
]
}'
Python
from ngris import Ngris
client = Ngris(api_key="<your_api_key>")
client.routing_rules.update("<endpoint_uuid>", "17", {
"name": "canary-25pct",
"priority": 5,
"target_agent_tags": "canary,v2",
"enabled": True,
"conditions": [
{"condition_type": "header", "condition_key": "X-Canary", "pattern": "true"},
],
})
Response — 200 OK
{
"id": 17,
"name": "canary-25pct",
"priority": 5,
"target_agent_tags": "canary,v2",
"enabled": true,
"conditions": [...]
}