Request Routing
A request to one of your APIs crosses several objects before it reaches a service. Knowing which one decides what tells you where to look, and where to change things.

Read this page when an API does not answer as expected, or before designing how several APIs share a gateway. It follows one request from the client to the service and names what decides at each step.
An access point is a listener of the gateway. An API instance is a route attached to one access point. The console uses the first terms; logs and upstream documentation use the second.
Resource model
Four objects take part in routing a request. Each decides one thing, and each is managed in its own place.
| Object | Decides | You manage it in |
|---|---|---|
| Gateway | Who can reach it at all: the internet, your private network, or the platform only | API Gateways |
| Access point | The port, the kind of traffic, and (for HTTPS) the certificate | The gateway |
| API instance | Which requests are for this API (by host name and path) and which service answers | API Instances |
| Policy | Whether a request may go on, and how the gateway treats it | Policies |
| Service or upstream | Where the request finally goes | The integration, or Upstreams |
Route matching
- The request arrives on an access point of the gateway.
- Among the API instances published on that access point, the gateway keeps those whose host name matches the one of the request.
- Among those, it keeps the one whose path matches best: the longest prefix wins.
- If none matches, the gateway answers
404.
| Request | API instances published | Goes to |
|---|---|---|
orders.example.com/orders/12 | orders.example.com | That API |
api.example.com/orders/12 | api.example.com + /orders, api.example.com + / | The one on /orders |
other.example.com/ | None for that name | 404 |
TLS termination and passthrough
Where TLS ends decides who holds the certificate and what the gateway can see. Only when the gateway terminates TLS can it read the request, and therefore route on the path and apply HTTP policies.
| Access point | The gateway | Your service receives |
|---|---|---|
| HTTPS | Ends the encryption with its certificate, reads the request | Plain HTTP |
| TLS | Does not decrypt: it reads only the name asked for, then forwards | The encrypted connection, which it must decrypt itself |
| HTTP, TCP | Forwards as it is | What the caller sent |
Policies that read the request (a key, a token, a header) need the gateway to see it: they apply to HTTP and HTTPS access points, not to TLS or TCP ones.
Policy evaluation order
A request passes, in this order:
- the client traffic policy of the gateway (connections, TLS version);
- the security rules, which decide whether the caller is allowed;
- the custom logic, if any;
- the backend traffic rules (rate limit, timeout, retry, load balancing);
- the service.
A policy attached to an API instance takes precedence over the same kind of policy attached to its gateway: the gateway's applies to the APIs that have none of their own.
DNS and wiring automated by the platform
- A host name that is not a wildcard is declared in DNS.
- With a path on a shared address, the prefix is removed before the request reaches your service.
- Every request is logged, measured and traced, visible in Monitoring.
Troubleshooting by response code
What the caller receives tells you which stage refused the request. Start from the answer and look at the object named in the last column.
| Answer | Meaning | Look at |
|---|---|---|
| The name does not resolve | The host name is not in DNS yet, or is misspelt | The host name of the API instance |
| Connection refused, or a timeout | The gateway is not reachable from where you call | The exposure mode of the gateway |
| A certificate error | The certificate does not cover the host name, or has expired | The certificate of the access point |
404 | No API instance matches the host name and path | The API instance, and the access point it is on |
401, 403 | A security rule refused the request | The security policy |
429 | The rate limit was reached | The backend traffic policy |
503 | No instance of the service is ready, or a cap was reached | The integration, the circuit breaker |
504 | The service took longer than the timeout | The integration, the timeout |
See also
- Policy tasks: one page per rule
- Tutorial: expose it as an API