0Pricing
C# Academy · Lesson

API Versioning Strategies

Version via URL, header, and query string.

Why Version an API?

Once clients depend on your API, you cannot break its contract. Versioning lets you ship breaking changes in a new version while old clients keep working against the old one.

// v1 returns { name }
// v2 returns { firstName, lastName }  (breaking)

URL Path Versioning

The most visible strategy puts the version in the path. It is unambiguous and easy to route, browse and cache.

GET /api/v1/products
GET /api/v2/products

All lessons in this course

  1. API Versioning Strategies
  2. Configuring Asp.Versioning
  3. Generating OpenAPI Documents
  4. Documenting Versioned APIs
← Back to C# Academy