Skip to main content
Traffic routing policies let you control how your UniFi gateway handles specific flows of network traffic. You can allow or deny traffic, mark packets with a DSCP value for downstream QoS, shape (rate-limit) a specific flow, or change routing behavior based on source, destination, protocol, or VLAN. These tools let you manage those routing rules directly from a conversation with your AI assistant.
QoS profile management (rest/qosprofile) and ProAV profile management endpoints were verified to not exist in the UniFi API and have been removed from the server. The tools documented here — traffic routing policies — use the /ea/sites/{siteId}/rest/routing endpoint, which is confirmed to work on supported hardware.

Traffic routes

list_traffic_routes

Returns all traffic routing policies for a site, sorted by priority.
string
required
The site identifier.
integer
Maximum number of routes to return. Defaults to 100.
integer
Number of routes to skip. Defaults to 0.
Example response

create_traffic_route

Creates a new traffic routing policy. Requires explicit confirmation.
string
required
The site identifier.
string
required
A descriptive name for this route.
string
required
What the gateway should do when traffic matches. Accepted values:
  • allow — pass traffic through normally
  • deny — drop matching traffic
  • mark — stamp packets with a DSCP value (use with dscp_marking)
  • shape — rate-limit the flow (use with bandwidth_limit_kbps)
string
An optional free-text description.
string
A source IP address or CIDR range to match (e.g., 192.168.10.0/24).
string
A destination IP address or CIDR range to match.
integer
A source port to match (1–65535).
integer
A destination port to match (1–65535).
string
Protocol to match. Accepted values: tcp, udp, icmp, all.
integer
Match traffic originating from a specific VLAN (1–4094).
integer
The DSCP value to stamp on matching packets (0–63). Only used when action is mark. Common values: 46 (EF — voice/video), 34 (AF41 — video conferencing), 0 (best effort).
integer
The maximum allowed bandwidth in kilobits per second. Only used when action is shape.
integer
Rule evaluation order (1–1000). Lower numbers are evaluated first. Defaults to 100.
boolean
Whether the route is active immediately. Defaults to true.
boolean
required
Must be true to create the route.
boolean
When true, validates the rule and returns the payload without creating it.

update_traffic_route

Updates an existing traffic routing policy. Only the fields you supply are changed. Match criteria (source/destination IP, port, protocol, VLAN) cannot be updated — delete and recreate the route if you need to change match conditions.
string
required
The site identifier.
string
required
The ID of the route to update.
string
New route name.
string
New action (allow, deny, mark, or shape).
string
New description.
boolean
Enable or disable the route.
integer
New priority (1–1000).
boolean
required
Must be true to apply the update.
boolean
Preview changes without applying them.

delete_traffic_route

Permanently deletes a traffic routing policy.
string
required
The site identifier.
string
required
The ID of the route to delete.
boolean
required
Must be true to delete the route.

DSCP marking reference

When using action: mark, the dscp_marking value determines how downstream switches and routers prioritize the packet. Common values used in network QoS:
DSCP marking is only effective when your upstream switches and ISP routers honour DSCP values. Check that your network equipment has QoS policies enabled before relying on marking.

Example: traffic shaping for a video conferencing setup

This example creates two routes: one that marks video conferencing UDP traffic with a high-priority DSCP value, and one that rate-limits bulk file transfer traffic so it does not crowd out interactive sessions.
Route priority is evaluated from lowest number to highest. A route with priority=5 is checked before one with priority=200. Place your most specific or highest-priority rules at the lowest numbers.