Skip to content

toggle_traffic_route

Enable or disable a traffic route without editing its other fields.

Side effects:

  • Flips the route’s enabled flag. Reads the current route first and PUTs the full object back with only enabled changed (read-modify-write), so the rest of the route is preserved.
  • Takes effect immediately: a disabled route stops steering its matched traffic, which then follows the default route.
  • Mutates controller state. Use dry_run=True to preview the change without applying.
toggle_traffic_route(route_id="65f...", enabled=False)
Parameter Type Required Default Description
route_id string yes The _id from list_traffic_routes.
enabled boolean yes True to enable the route, False to disable it.
controller string no “default” Name of the UniFi controller to target. Defaults to "default".
dry_run boolean no false Preview the change without applying it. Returns the predicted change set.