#API versioning on workers
4 messages · Page 1 of 1 (latest)
In general APIs, some folks put version numbers in the route itself. Others put version info in the payload.
I would use it in a route if you plan to support old APIs in the future.
I've generally gone with a major version in the URI (eg https://api.example.com/v1), but have also seen the version in the request headers like with GitHub's API. Really depends on your versioning philosophy with the project.
Like so: https://docs.github.com/en/rest/overview/api-versions?apiVersion=2022-11-28