aj-geddes avatar

Api Versioning Strategy

You're building an API that needs to evolve without breaking existing clients. This walks you through URL versioning, header versioning, deprecation timelines, and backward compatibility patterns. The reference guides cover REST, GraphQL, and gRPC with real TypeScript and Python examples for version routing, adapter patterns, and testing strategies. The best practice list is solid: version from day one, support at least two versions simultaneously, give 6 to 12 months deprecation notice, and don't support more than three versions at once. It's comprehensive enough that you could hand this to a junior dev and trust they'll set up versioning correctly instead of painting themselves into a corner six months from now.

skills.sh installs
472
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill api-versioning-strategy --agent claude-code

Installs into .claude/skills of the current project.

Files

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" }],
  });
});

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Backend & APIs, AI & Agent Building
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1secondsky avatarapi-error-handlingsecondsky/claude-skillsImplements standardized API error responses with proper status codes, logging, and user-friendly messages. Use when building production APIs, implementing error455skills.sh installs
2sickn33 avatarapi-testing-observability-api-mocksickn33/antigravity-awesome-skillsapi testing observability api mock451skills.sh installs
3secondsky avatarwebsocket-implementationsecondsky/claude-skillsImplements real-time WebSocket communication with connection management, room-based messaging, and horizontal scaling. Use when building chat systems, live noti440skills.sh installs
4secondsky avatarapi-filtering-sortingsecondsky/claude-skillsBuilds flexible API filtering and sorting systems with query parameter parsing, validation, and security. Use when implementing search endpoints, building data 432skills.sh installs
5onewave-ai avatardatabase-schema-designeronewave-ai/claude-skillsDesign optimized database schemas for SQL and NoSQL databases including tables, relationships, indexes, and constraints. Creates ERD diagrams, migration scripts426skills.sh installs
6vercel avatarai-gatewayvercel/vercel-pluginai gateway423skills.sh installs