How do you version an API?

REST API design and errors · Freshers and experienced

Model answer

Common approaches: put the version in the URL (/api/v1/users), or use a header. URL versioning is the easiest to understand and route. Avoid breaking changes inside a version, add fields rather than removing them, and announce deprecations before retiring old versions.

Learn this topic

Build a REST API: Create, Read, Update and Delete Tasks in the course Node.js and Express: Build a Back End API from Scratch.

Sign in to add your own answer.

More questions