api-versioning-strategy▌
aj-geddes/useful-ai-prompts · updated Apr 8, 2026
Comprehensive guide to API versioning approaches, deprecation strategies, backward compatibility techniques, and migration planning for REST APIs, GraphQL, and gRPC services.
API Versioning Strategy
Table of Contents
Overview
Comprehensive guide to API versioning approaches, deprecation strategies, backward compatibility techniques, and migration planning for REST APIs, GraphQL, and gRPC services.
When to Use
- Designing new APIs with versioning from the start
- Adding breaking changes to existing APIs
- Deprecating old API versions
- Planning API migrations
- Ensuring backward compatibility
- Managing multiple API versions simultaneously
- Creating API documentation for different versions
- Implementing API version routing
Quick Start
Minimal working example:
// express-router.ts
import express from "express";
const app = express();
// Version 1
app.get("/api/v1/users", (req, res) => {
res.json({
users: [{ id: 1, name: "John Doe" }],
});
});
// Version 2 - Added email field
app.get("/api/v2/users", (req, res) => {
res.json({
users: [{ id: 1, name: "John Doe", email: "john@example.com" }],
});
});
// Shared logic with version-specific transformations
app.get("/api/:version/users/:id", async (req, res) => {
const user = await userService.findById(req.params.id);
if (req.params.version === "v1") {
res.json({ id: user.id, name: user.name });
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Versioning Approaches | Versioning Approaches |
| Backward Compatibility Patterns | Backward Compatibility Patterns |
| Deprecation Strategy | Deprecation Strategy |
| Migration Guide Example | Migration Guide Example |
| Response Structure | Response Structure |
| Date Format | Date Format, Error Format |
| JavaScript/TypeScript | JavaScript/TypeScript, Python |
| GraphQL Versioning | GraphQL Versioning |
| gRPC Versioning | gRPC Versioning |
| Version Detection & Routing | Version Detection & Routing |
| Testing Multiple Versions | Testing Multiple Versions |
| Pattern 1: Version-Agnostic Core | Pattern 1: Version-Agnostic Core, Pattern 2: Feature Flags for Gradual Rollout, Pattern 3: API Version Metrics |
Best Practices
✅ DO
- Version from day one (even if v1)
- Document breaking vs non-breaking changes
- Provide clear migration guides with code examples
- Use semantic versioning principles
- Give 6-12 months deprecation notice
- Monitor usage of deprecated APIs
- Send deprecation warnings to API consumers
- Support at least 2 versions simultaneously
- Use adapters/transformers for version logic
- Test all supported versions
- Log which API version is being used
- Provide migration tooling when possible
- Be consistent with versioning approach
❌ DON'T
- Change API behavior without versioning
- Remove versions without notice
- Support too many versions (>3)
- Use different versioning strategies in same API
- Break APIs without incrementing version
- Forget to update documentation
- Deprecate too quickly (<6 months)
- Ignore feedback from API consumers
- Make every change a new version
- Use version numbers inconsistently
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★67 reviews- ★★★★★Dev Torres· Dec 28, 2024
api-versioning-strategy reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Carlos Thomas· Dec 20, 2024
We added api-versioning-strategy from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Mateo Verma· Dec 12, 2024
api-versioning-strategy reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Noah Perez· Dec 12, 2024
Registry listing for api-versioning-strategy matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Ganesh Mohane· Dec 8, 2024
Solid pick for teams standardizing on skills: api-versioning-strategy is focused, and the summary matches what you get after install.
- ★★★★★Sakshi Patil· Nov 27, 2024
We added api-versioning-strategy from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Diya Rahman· Nov 19, 2024
I recommend api-versioning-strategy for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Carlos Rao· Nov 11, 2024
Solid pick for teams standardizing on skills: api-versioning-strategy is focused, and the summary matches what you get after install.
- ★★★★★Dev Sanchez· Nov 3, 2024
I recommend api-versioning-strategy for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Daniel Yang· Nov 3, 2024
Useful defaults in api-versioning-strategy — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 67