Removing an API version from the codebase is a development project. It takes time, requires testing, and may be blocked by dependencies. Network-layer restriction (gateway routing rules, WAF rules, firewall rules) can be applied immediately, making the old version unreachable from the internet even while it still runs on the server.
/api/v1/At the API gateway (Nginx, Kong, AWS API Gateway, Azure APIM), add a routing rule that returns HTTP 410 Gone for all requests to old version paths (/api/v1/, /v1/, /legacy/). This is a one-line change at the gateway level and takes effect immediately across the entire infrastructure without touching application code. For subdomains (staging-api.): DNS removal or firewall egress block prevents external resolution.
Ask your team whether old API versions can be blocked at the network or gateway level before the codebase cleanup is finished. Removing access is faster than removing code, and it eliminates the attack surface immediately.