Manage Routes with the API
Everything you can do in the dashboard you can do over HTTP, so routes can be created by a deploy script, a signup flow, or a job that runs per customer. This guide uses curl and jq. You’ll need an API key (see Managing API Keys) and the CREDENTIAL variable from Authentication. Remember the rate limits.
1. Find your domain
Note the id of the domain the route will live under. Use dvt.fyi if you haven’t added your own. Then:
2. Create a route
The slug is the path after the domain. On a shared domain such as dvt.fyi it must be unique across all organizations, so prefix it with something of your own. targetStrategy can be any strategy your plan includes, and strategies that read a header or query parameter also need targetStrategySelector. See Target Selection.
3. Add targets
A route needs at least one target before it resolves.
Target URLs must use http or https. For non-weighted strategies, set selectorValue instead of weight. For example, "selectorValue": "US" on a Country route.
The link https://<your-domain>/acme-download is now live, and roughly 10% of visitors reach the canary.
4. Change weights
Update a target by sending only the fields you want to change:
The change applies to the next request, with nothing to deploy. Ramp up the new target’s weight, and lower the old target’s to match, in whatever steps suit you. See Canary Rollout for the approach.
5. Roll back
Set the new target’s weight back to 0, which sends all traffic to the other target:
Or take the target out of rotation entirely by disabling it:
Set "enabled": true to bring it back. A disabled target keeps its URL and weight.
One route per customer
Because routes are cheap and unlimited, you can give every customer, tenant, or record its own link. Create the route when the customer is created, and store the returned id next to your own record so you can update it later:
Add a target to each route, and when the customer’s destination changes, update that target’s url. The link you gave them never changes.
Clean up
Deleting a route is permanent. To stop one from resolving without deleting it, update it with {"enabled": false}.
Next
- API Guide: pagination, QR codes, and more.
- API Reference: every endpoint and field.

