Update Routing Rule

PUT /v1/endpoints/{uuid}/routing-rules/{rule_uuid}

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
The endpoint's uuid from /endpoints.
rule_uuid string (uuid) Req
The routing rule's uuid from the 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.

Request body

Same fields as create: name, priority, target_agent_id / target_agent_tags, enabled, fallback, conditions. The whole rule is replaced — passing only some fields zeroes the rest, and the conditions are replaced by the ones you send. So the update is validated like a create: name, at least one (non-null) condition, and target_agent_id or target_agent_tags are required.

Response (200 OK)

The rule as stored, read back after the write: its uuid, its real created_at / updated_at, and its conditions as saved. Same shape as a list entry.

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
Invalid JSON; missing name (Rule name is required), empty conditions (At least one condition is required) or a null entry in it (Invalid condition: conditions[N] is null), neither target_agent_id nor target_agent_tags set (Either target_agent_id or target_agent_tags is required); an application endpoint (Routing rules are not supported for agentless (static hosting) endpoints.), or an integer rule id after the sunset (integer_id_unsupported).
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 account). A rule of another endpoint reads like an unknown one (Routing rule not found).
409 Conflict
The endpoint or the rule is paused over your plan's limits ("code": "quota_paused").
500
Database error during update.
Request
curl -X PUT "https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/routing-rules/019b962b-971a-77df-97b0-e3905fa06cd4" \ -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("019bb1e4-e785-77d2-9966-c3cff31d0a0e", "019b962b-971a-77df-97b0-e3905fa06cd4", { "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
{ "uuid": "019b962b-971a-77df-97b0-e3905fa06cd4", "endpoint_uuid": "019bb1e4-e785-77d2-9966-c3cff31d0a0e", "name": "canary-25pct", "priority": 5, "target_agent_tags": "canary,v2", "enabled": true, "fallback": false, "conditions": [ {"rule_uuid": "019b962b-971a-77df-97b0-e3905fa06cd4", "condition_type": "header", "condition_key": "X-Canary", "pattern": "true", "negate": false} ], "created_at": "2026-04-29T13:00:00Z", "updated_at": "2026-04-30T09:12:00Z" }
Was this helpful?
On this page
Update Routing Rule
Was this helpful?