Tunnel Route API Endpoints, route_id, and CIDR Deprecation
How private network tunnel routes move from CIDR-encoded API paths to route_id-based endpoints, and what to change before removal.
This page summarises Cloudflare documentation on teamnet tunnel routes: the REST endpoints that send a private IP range through Cloudflare Tunnel or Cloudflare Mesh. If you automate routes with curl, CI/CD, cloudflared, or Terraform, you need to know that CIDR-in-the-URL endpoints are going away and route_id becomes the handle for update and delete.
teamnet tunnel routes: what the API controls
Section titled “teamnet tunnel routes: what the API controls”A tunnel route (teamnet route) tells Cloudflare which CIDR on your private network should be reached via a given tunnel or Mesh node. The API still names Mesh connectors warp_connector, but the routing behaviour is the same idea for Tunnel and Mesh.
The CIDR-encoded route endpoints are deprecated in favor of the standard, route_id-based endpoints that already exist today. Both sets of endpoints route a private network through Cloudflare Tunnel or Cloudflare Mesh (the API still refers to Mesh nodes as warp_connector) — only the request shape changes.
— Cloudflare, Zero Trust Networks route endpoints and Cloudflare Tunnel connections field retiring on October 5, 2026
In plain terms: you are not changing what gets routed, only how you identify a route in HTTP paths and JSON bodies.
CIDR-encoded endpoints deprecation: what is being removed
Section titled “CIDR-encoded endpoints deprecation: what is being removed”Cloudflare will remove the CIDR-encoded route endpoints on October 5, 2026. Until then, old and new shapes may both exist; after that date, calls that put an encoded network in the path will fail.
Deprecated paths (all under accounts/{account_id}/teamnet/routes):
| Operation | Deprecated (CIDR in path) | Replacement (route_id) |
|---|---|---|
| Create | POST .../teamnet/routes/network/{ip_network_encoded} |
POST .../teamnet/routes with network and tunnel_id in the body |
| Update | PATCH .../teamnet/routes/network/{ip_network_encoded} |
PATCH .../teamnet/routes/{route_id} |
| Delete | DELETE .../teamnet/routes/network/{ip_network_encoded} |
DELETE .../teamnet/routes/{route_id} |
The route identifier moves from a URL-encoded CIDR in the path (/network/{ip_network_encoded}) to a stable route_id in the path; on create, the network field belongs in the request body, not the URL.
route_id: how to find it before you migrate scripts
Section titled “route_id: how to find it before you migrate scripts”Update and delete on the new API require route_id, not the CIDR string in the URL.
Capture each route’s route_id by calling List tunnel routes, or read it from the response the first time you create a route with the replacement endpoint.
— Cloudflare, Zero Trust Networks route endpoints and Cloudflare Tunnel connections field retiring on October 5, 2026
Store route_id wherever you today store the encoded CIDR path segment (config files, secret managers, Terraform state). If you only know the CIDR, list routes for the account and map CIDR → route_id once, then patch your automation to use the ID.
Migrate tunnel route API calls: create, update, delete
Section titled “Migrate tunnel route API calls: create, update, delete”Create a route: network in the body instead of the path
Section titled “Create a route: network in the body instead of the path”Old style: URL-encode the CIDR into the path (example 172.16.0.0%2F16) and pass tunnel_id in JSON.
New style: POST to .../teamnet/routes with network and tunnel_id in the body (optional fields such as comment stay in JSON).
# Before: create a route by URL-encoding the CIDR into the pathcurl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/network/172.16.0.0%2F16 \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{"tunnel_id": "'$TUNNEL_ID'", "comment": "Example comment for this route."}'
# After: create a route with the network in the request bodycurl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{"network": "172.16.0.0/16", "tunnel_id": "'$TUNNEL_ID'", "comment": "Example comment for this route."}'— pattern from Zero Trust Networks route endpoints and Cloudflare Tunnel connections field retiring on October 5, 2026
Save the route_id from the create response for later PATCH and DELETE.
Update or delete a route: use route_id in the path
Section titled “Update or delete a route: use route_id in the path”curl -X PATCH https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/$ROUTE_ID \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{"comment": "Updated comment for this route."}'
curl -X DELETE https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/$ROUTE_ID \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN'For Mesh, the same route_id pattern appears in the product docs. Example update with both network and comment:
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/$ROUTE_ID" \ --request PATCH \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --json '{ "network": "10.0.0.0/24", "comment": "Updated description" }'Delete uses the same base URL with DELETE and no body — see Routes (Cloudflare Mesh) and the Mesh routes page (equivalent UI and API steps).
API token permissions for route changes
Section titled “API token permissions for route changes”To call update or delete, the token needs at least one of:
- Cloudflare One Networks Write
- Cloudflare Tunnel Write
cloudflared and Terraform: what else to update
Section titled “cloudflared and Terraform: what else to update”Cloudflare’s changelog groups non-HTTP automation with the same migration:
Update any scripts, backend services, or CI/CD pipelines that call the CIDR-encoded endpoints directly.
— Cloudflare, Zero Trust Networks route endpoints and Cloudflare Tunnel connections field retiring on October 5, 2026
cloudflared: if you use cloudflared tunnel route ip add or cloudflared tunnel route ip delete, upgrade cloudflared to the latest release so those commands use the supported API surface (changelog entry).
Terraform: use a current cloudflare_zero_trust_tunnel_cloudflared_route resource and a current Cloudflare Terraform provider so plans do not recreate routes via deprecated paths (changelog entry).
Mesh dashboard: edit or delete a route without raw API paths
Section titled “Mesh dashboard: edit or delete a route without raw API paths”You can change the CIDR or description in the UI: Networking → Mesh → select your node → Routes, then edit or delete the row. That path does not depend on URL-encoded CIDR API routes, but any API or IaC you run in parallel should still follow the route_id model above — see Routes (Cloudflare Mesh).
Common mistakes when moving off CIDR paths
Section titled “Common mistakes when moving off CIDR paths”- Encoding the CIDR only in the path on create after the deadline — create must use
POST .../teamnet/routeswith a plainnetworkstring such as172.16.0.0/16in the body. - PATCH or DELETE by CIDR path — after migration, only
.../teamnet/routes/{route_id}is valid for update and delete. - Losing
route_id— without it you cannot update comments or retire a route programmatically; list routes or persist the ID from create responses. - Stale
cloudflaredor Terraform — CLI and provider versions may still call deprecated endpoints until upgraded.
How to check this on your site
Section titled “How to check this on your site”-
Search repositories and runbooks for
teamnet/routes/network/orip_network_encoded; every hit should be replaced withteamnet/routesplusroute_idwhere applicable. -
List existing routes via the Cloudflare API or dashboard, record each
route_idnext to its CIDR, and confirm update/delete tests use.../teamnet/routes/$ROUTE_ID(see Routes (Cloudflare Mesh)). -
Run a dry-run create on a test CIDR using
POST .../teamnet/routeswithnetworkandtunnel_idin the body; confirm the response includesroute_id(changelog post). -
If you use
cloudflared tunnel route ipor Terraformcloudflare_zero_trust_tunnel_cloudflared_route, upgrade tools and re-apply so nothing still targets CIDR path endpoints (changelog post). -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page does not match your experience or the official docs, email yimasynthetic@gmail.com with the page URL and the exact sentence you think is wrong so it can be corrected.