DEV Community

Phillip Lakis
Phillip Lakis

Posted on

How to handle a new api version?

Im curious on what is the best way,
I have a new endpoint on v2 but needed to support some legacy users on v1 on 2-3 endpoints. Authentication is on v1, Is it normal to keep all endpoints active and only a handful on v2? Or do I re write everything on v2 and keep only a handful on v1?

Would love the communities opinion

Top comments (1)

Collapse
 
zeedu_dev profile image
Eduardo Zepeda

Change all to v2, even if some endpoints remain the same, the version change should be uniform.

The two scoops of django's author recommends to add a warning to every call of your api that will change, also make a public announcement on social media, blogs and email; something like "This api will not be supported after date..." The announcement should be done many months prior to the change.

Also, modify the old version of the api so it returns a 410 error and include:

A link to the new API’s endpoint.
A link to the new API’s documentation.
A link to an article describing the details of the shut down.