Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Your public APIs are used by partners for years. How do you decide when an API can be retired, and how do you handle breaking changes over a long time?

I decide retirement from data, not from age: usage is tracked per client, so we know exactly who still calls an API and how often. A retirement is then a planned process with business owners: announce deprecation with dates, send Deprecation and Sunset headers, provide migration guides and an overlap period long enough for partners' release cycles, and follow up with the remaining callers. Over the years, most change should be additive, because a stable contract is far cheaper than running several versions.

Why this question is asked

Partner APIs are long-lived contracts with other companies' systems. Partners plan their releases months ahead, some integrations are maintained by agencies that are long gone, and a broken API can mean lost orders and contract penalties. At a senior level, interviewers want to see a process that balances our need to move on with partners' need for stability. In this answer, we will look at why usage data comes first, how to avoid breaking changes most of the time, how to deprecate and retire an API step by step, and who has to be involved.

1Know Who Uses What

We cannot retire an API safely if we do not know who uses it. So every partner call must be attributable to a client: an API key, an OAuth client id, or a certificate identity. The gateway logs each call with the client, the operation and the API version, and a dashboard shows calls per client per endpoint over time.

With that data, retirement questions become concrete. Instead of 'can we turn off v1?', we ask 'v1 still gets 40,000 calls a day from 6 partners, 3 of which make 95 percent of them'. We can contact those partners by name, see when their traffic moves, and know when the last caller is gone. Without it, every retirement is a gamble, and teams end up keeping old versions forever out of fear.

2Prefer Additive Change Over New Versions

Most changes do not need to break anyone. Adding an optional field to a response, adding a new optional parameter, adding a new endpoint or a new enum value that clients are told to tolerate are all additive. Clients that follow the robustness rule, ignore what you do not understand, keep working. Our API guideline should require that tolerance from partners and document it.

Breaking changes, such as removing or renaming a field, changing a type, making an optional field required, or changing meaning, need a new version, and every version we run costs us: two code paths, two sets of tests, two sets of documentation and support questions about both. So the long-term strategy is to design contracts carefully, check every change for compatibility in CI, and bundle the rare breaking changes into a new major version instead of releasing many small ones.

Which changes break partners?
ChangeBreaking?How to ship it
Add optional response fieldNo, if clients ignore unknown fieldsJust release
Add optional request parameterNoJust release, with a default
Add new endpointNoJust release
Rename or remove a fieldYesNew version, or add the new field and deprecate the old
Make a field requiredYesNew version
Change a field's meaningYes, and silentlyNew field with the new meaning

3Announce Deprecation With Dates and Headers

When an API or version must go, we deprecate it formally. That means a published notice with two dates: when it was deprecated, and the sunset date when it will stop working. The notice goes into the developer portal, the changelog and a direct message to each affected partner from the usage data.

We also put it into the responses themselves, so the partners' engineers see it in logs and tools. The Deprecation header, standardised in RFC 9745, says the resource is deprecated and since when, and the Sunset header from RFC 8594 says when it will be removed. A Link header can point to the migration guide.

Java
HTTP/1.1 200 OK
Deprecation: @1782864000 # deprecated since 2026-07-01 (RFC 9745 date format)
Sunset: Fri, 01 Jan 2027 00:00:00 GMT # removed on this date (RFC 8594)
Link: <https://developer.example.com/migrate/orders-v2>; rel="deprecation"; type="text/html"
// In Spring, a filter or interceptor can add these headers for /v1/**.
// Spring Framework 7's API versioning support includes a deprecation handler
// that can send them for deprecated versions; check your version for details.

Notice that the dates are concrete. 'Deprecated, will be removed in the future' gives partners nothing to plan with, and they will postpone the work until it hurts.

4Give Migration Guides and an Overlap Period

Partners need two things to move: clear instructions and enough time. The migration guide maps every old operation and field to its new equivalent, with request and response examples, and calls out behaviour differences. A sandbox where partners can test against the new version helps a lot.

The overlap period, when both versions run, must fit partners' release cycles, not ours. For a partner that releases quarterly and needs a test cycle, six months is a minimum, and twelve months is common for business-critical integrations. The contract with partners may specify this, so legal and account managers should confirm it before we announce dates.

Step throughRetiring a partner API version
  1. Check usage per clientWho still calls v1, and how often
  2. Agree dates with business ownersContract terms, revenue at stake
  3. Announce deprecationPortal, changelog, direct contact, headers
  4. Overlap period: v1 and v2 both runMigration guide, sandbox, support
  5. Track remaining callersContact the ones that have not moved
  6. Still significant traffic near sunset?Important partner not ready
    YesEscalate: extend or agree a planNoProceed
  7. Brownouts before sunsetShort planned outages to surface forgotten callers
  8. Sunset: return 410 Gone, then remove codeKeep the tombstone response for a while

8 steps in order. Play them, or step through them one at a time.

5Make Retirement a Planned Process With Business Owners

Retirement is not only a technical decision. If the last partner on v1 is a large customer, turning it off is a business risk that the business must accept or avoid. So each API has a business owner, and retirements go through a short decision with them: the usage data, the cost of keeping the old version, the partners affected and the proposed dates.

Near the sunset, the remaining callers are contacted individually, and a few brownouts, planned short periods where the old version returns errors, flush out forgotten integrations while there is still time to react. After the sunset, the old endpoints return 410 Gone with a link to the guide for a while, rather than disappearing into 404s, and then the code is removed. Running this the same way every time turns retirements from crises into routine, which is what lets the platform keep evolving for years.

6Follow-up questions

What if a key partner refuses to migrate?

First find out why: missing features in the new version, lack of developer capacity, or a contract issue. Often we can help, by adding a missing feature or offering support for their migration. If not, the business owner decides between extending the sunset for that partner, perhaps through a separate gateway route with a charge, or accepting the risk. The decision is explicit, not a silent indefinite extension.

How do you handle a security issue that forces a fast breaking change?

Security can override the normal timelines. We contact affected partners directly, explain the risk, give the shortest workable window, and offer help. Usage data again tells us exactly who to call. The incident should then feed into contract design so the same kind of issue does not require a break next time.

7Conclusion

In this answer, we saw that retiring partner APIs starts with tracking usage per client, so we know who is affected. Most change should be additive, with breaking changes bundled into rare new versions. A retirement is announced with concrete dates, Deprecation and Sunset headers and direct contact, backed by migration guides and an overlap period that fits partners' release cycles, and run as a planned process with business owners, brownouts and a 410 Gone tombstone at the end.

What to say in the interviewAbout 80 seconds aloud

Open with

The first thing I need is usage data per client. Every partner call should be identified by an API key or client id, and the gateway should show calls per client, per endpoint, per version.

Then, if they want more

Then retirement is a concrete question: who still uses v1 and how much, rather than a guess. Second, I'd try hard not to need retirements often. Most changes should be additive, like new optional fields or new endpoints, partners are told to ignore unknown fields, and CI checks every spec change for breaking changes.

Real breaking changes get bundled into a rare new major version, because each running version costs code, tests and support. When a version does have to go, it's a planned process.

We agree dates with the business owner, since turning off a big partner is a business risk, then announce it with concrete dates in the portal, the changelog and directly to each affected partner, and we add Deprecation and Sunset headers with a link to the migration guide.

The overlap period has to fit partners' release cycles, often six to twelve months. Near the end we chase the remaining callers individually, run short brownouts to find forgotten integrations, and at the sunset return 410 Gone for a while before removing the code.

About this answer

Last updated
12 November 2026
Versions it names
Spring Framework 7
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your public APIs are used by partners for years. How do you decide when an API can be...": https://scrivio-interview-library.netlify.app/spring-boot/rest-controllers/abfe5a4a86/