Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ZhakirSetie's avatar

Best practice to sunset an API version ?

I'm going to do it quick: a couple of years ago, I ended up creating an API, didn't planned its life well, and ended up making questionable choices down the line. Now, I'm getting constant hits to its endpoints, and I want to retire this particular version and I have no real way to communicate changes with the users that uses it, except maybe the github repo that I know people don't check everyday...

Right now, there's not authentication, and a rate limit is enforced globally. What I want to have, to make it future proof and have a way to communicate changes with people is, yeah, to make an auth system. But how can I do this at this point, since I can't even talk to the users? https://speedtest.vet/

Have both live at the same time? Close the old one directly and have people see the repo / docs ? Lower rate limit to have people come to the repo / docs and check? https://showbox.tools/

0 likes
2 replies
martinbean's avatar

@zhakirsetie Well, it’s going to be difficult. If you don’t know who’s using the API then you log who’s using it and reach out with them to warn them of its pending closure and point them to the new API to use.

So, set a sunset date, and then disable the API at that date. If the API is key to someone’s application, then they’re obviously going to seek out information and if you have it prominently displayed that version X was retired on whatever date after however long notice, and to use version Y in place.

Snapey's avatar

I agree with @martinbean , sooner or later you have to rip the plaster off

I assume these users don't pay you anything so they can't really expect you to just keep serving it forever

Instead of just turning it off though, you could return content that points them to the information about the new version

1 like

Please or to participate in this conversation.