API Routing
Last updated Sep 29, 2026 API Shield Routing allows you to expose a single external API that routes requests to different back-end services, even when those services use different paths or hostnames than your zone.
Note
The term Source Endpoint refers to the endpoint managed by API Shield in Endpoint Management. The term Target Endpoint refers to the ultimate destination the request is sent to by the Routing feature.
Process
You must add Source Endpoints to Endpoint Management through established methods, including uploading a schema, via API Discovery, or by adding manually, before creating a route.
To create a route, you will need the operation ID of the Source Endpoint. To find the operation ID in the dashboard:
- In the Cloudflare dashboard, go to the Web Assets page. Go to Web assets ↗
- In the Operations tab, filter the operations to find your Source Endpoint.
- Expand the row for your Source Endpoint and note the operation ID field.
- Select the copy icon to copy the operation ID to your clipboard.
Once your Source Endpoints are added to Endpoint Management, use the following steps to create and verify routes on any given operation ID:
Create a route
- In the Cloudflare dashboard, go to the Web Assets page. Go to Web assets ↗
- In the operations list, select an existing endpoint and expand its details.
- Under Routing, select Create route.
- Enter the target URL or IP address to route your endpoint to.
- Select Deploy route.
Note
You can reorder path variables if they are present. For example, you can route /api/{var1}/users/{var2} to /{var2}/users/{var1}. Segments of the path that are not variables may be added or omitted entirely.
You can also edit or delete a route by selecting Edit route on an existing route.
Verify a route
After sending a request to your Source Endpoint, you should see the contents of the back-end service as if you called the Target Endpoint directly.
If API Shield returns unexpected results, check your Source Endpoint host, method, and path and verify the Route to ensure the Target Endpoint value is correct.
Availability
API Shield Routing is currently in an open beta and is only available for Enterprise customers subscribed to API Shield. Enterprise customers who have not purchased API Shield can preview API Shield as a non-contract service ↗︎ in the Cloudflare dashboard or by contacting your account team.
Limitations
The Target Endpoint cannot be routed to a Worker if the route is to the same zone.
You cannot change the method of a request. For example, a GET Source Endpoint will always send a GET request to the Target Endpoint.
You must use all of the variables in the Target Endpoint that appear in the Source Endpoint. For example, routing /api/{var1}/users/{var2} to /api/users/{var2} is not allowed and will result in an error since {var1} is present in the Source Endpoint but not in the Target Endpoint.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/api-shield/management-and-monitoring/api-routing/#page","headline":"API Routing","description":"Route API requests to different back-end services using API Shield Routing.","url":"https://developers.cloudflare.com/api-shield/management-and-monitoring/api-routing/","inLanguage":"en","image":"https://developers.cloudflare.com/api-shield/management-and-monitoring/api-routing/og.png?v=2b93b8249ae8d0f5","dateModified":"2026-09-29","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Create interactive API documentation portals from saved endpoints or schemas. title: Build developer portals image: https://developers.cloudflare.com/api-shield/management-and-monitoring/developer-portal/og.png?v=7ea2dd055dfcc6a3
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/api-shield/llms.txt
Use this file to discover all available pages before exploring further.
Docs