Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
|
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Engineering
  4. Service Design Guidelines Part 2: API Versioning
Engineering
May 24, 2021
4 min read

Service Design Guidelines Part 2: API Versioning

Vikas Vijendra

We looked at service design considerations in the first part of this blog series. In this next part, I'd like to share some best practices for API versioning - a topic that comes up quite often with every customer as it is one of the key concerns when implementing API gateways.

There are two ways to version RESTful APIs: URI and header-based, as summarized in this REST API tutorial. While there may be variations of these strategies (e.g., DNS-based), the focus in this blog will be to show how Kong supports both popular methods. This includes any variations that you may want to apply.

We will keep microservices versioning strategies that utilize other protocols like gRPC, GraphQL, eventing, etc. out of scope for this. Instead, we'll cover the RESTful APIs documented with OpenAPI specification, which remains the most common way to publish and manage APIs with versions today.

How Do API Versions Work in Kong?

The answer to this is simple: versions are handled by Routes, as illustrated below.

Kong Konnect Create a Route

Real-World Example

Let's take an example of an Order API. You could handle versions in two ways, so I have created three OpenAPI specifications to use in each case using Insomnia. The table below captures the versioning style and lifecycle stage, which is supported in both Insomnia and Kong's Dev Portal.

Open API versioning and lifecycle

Here is what my Insomnia workspace looks like for Order APIs:

Insomnia Open API Versioning

Order API v1.0

Insomnia offers a design view to provide a preview of OpenAPI specification.

Insomnia Open API Specification

You could deploy the v1.0 API configuration in decK format using the built-in OpenAPI to Kong configuration tooling. Insomnia automatically generates the regular expression for the route/path from the specification, saving you time to focus on implementing your business logic for the Order API.

Order API v1.1

Insomnia Order API Versioning

Kong configuration for the API in decK format:

Order API v1 (versioned by Header)

As you can see in this scenario, the version sends as a header instead of the URI path style in the previous two APIs.

Insomnia Open API Header Version

Kong configuration for the API in decK format:

We've seen how you can design your APIs, following API Guidelines, with versions and tags that can be deployed to Kong and managed/viewed within Kong Manager. Next, let's see how you can use these APIs in the Dev Portal.

Publishing to the Dev Portal

Kong Dev Portal supports content-level permissions management. This serves two primary purposes:

  1. Provide role-based view access to APIs published on the Catalog
  2. Manage multiple versions on the Catalog (e.g., tag with lifecycle stages or hide deprecated or un-used versions)

Kong Dev Portal API Versioning

Here is where you can manage content permissions within the Dev Portal section of Kong Manager:

Kong Dev Portal Manage Content Permissions

In the example below, you can specify the view permission for API specifications based on the below levels:

  • Public/Unauthenticated
  • Registered/Authenticated
  • Role-based (Authenticated)

Dev Portal View Permissions API specifications

Implementation Guidelines

Until now, we've focused on designing APIs to handle versions within API specifications. Next, we'll need to route the requests based on the incoming version to the appropriate API implementation (e.g., a microservice). Kong, with its transformer plugins, makes this very simple. Below I list two approaches on how you can route to the upstream (backend API implementation) based on the type of versioning you have within your API specification.

Approach 1 - URI-Based Versioning With URL Rewriting Before Routing to Backend Services

URI-Based Versioning With URL Rewriting Before Routing to Backend Services

https://docs.konghq.com/hub/kong-inc/request-transformer-advanced/#template-as-value

https://docs.konghq.com/hub/kong-inc/route-transformer-advanced/

Approach 2 - Header-Based Versioning

OpenAPI Header-Based Versioning

Handling Deprecation

A quick note on handling deprecated APIs as per standard. The IETF Internet draft states as below:

The HTTP Deprecation Response Header Field can be used to signal to

consumers of a URI-identified resource that the resource has been

deprecated. Additionally, the deprecation link relation can be used

to link to a resource that provides additional context for the

deprecation, and possibly ways in which clients can find a

replacement for the deprecated resource.

You can easily use the Response Transformer plugin to signal a specific API is deprecated so the consumer can start taking steps to move to a more recent version of the API.

Konnect ServiceHub

ServiceHub in Konnect SaaS control plane is a central API repository that acts as a service registry for easy discoverability of APIs. The good news is we have brought versioning as an in-built feature for Service packages.

Manage API Versions with Konnect ServiceHub

Service Packages and Versions

Here is how the same Order API with its three different versions sit within one Service package in Service Hub. Cool, isn't it?

Konnect Manage API Versions

Migration

Are you thinking, "How could I move between Konnect self-managed and Hybrid SaaS to take advantage of versions in Service package?" Not to worry, with the new deck convert command, released in decK v1.7, you’re now able to convert the configuration between them easily.

Let Us Know How Your API Versions Turn Out

Start a Kong Konnect free trial or contact us if you have any questions as you're getting set up.

Once you've set up your service design guidelines, you may find these other tutorials helpful:

  • 3 Ways Kong Helps With API Gateway Governance
  • Getting Started with Kong Mesh and Open Policy Agent
  • Protect Your APIs With Kong Konnect and Fastly (Signal Sciences)
API DesignAPI DevelopmentAPI Development

More on this topic

Videos

Native API Mocking in Insomnia

Videos

Insomnia Overview: Collaborative API Development

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo
Topics
API DesignAPI DevelopmentAPI Development
Share on Social
Vikas Vijendra

Recommended posts

6 Reasons Why Kong Insomnia Is Developers' Preferred API Client

Kong Logo
EngineeringAugust 8, 2025

So, what exactly is Kong Insomnia? Kong Insomnia is your all-in-one platform for designing, testing, debugging, and shipping APIs at speed. Built for developers who need power without bloat, Insomnia helps you move fast whether you’re working solo,

Juhi Singh

Unpacking Distributed Applications: What Are They? And How Do They Work?

Kong Logo
EngineeringMarch 19, 2024

Distributed architectures have become an integral part of modern digital landscape. With the proliferation of cloud computing, big data, and highly available systems, traditional monolithic architectures have given way to more distributed, scalable,

Paul Vergilis

Day 0 Service Mesh: Simplifying Microservices Management

Kong Logo
EngineeringJanuary 31, 2024

The acceleration of microservices and containerized workloads has revolutionized software delivery at scale. However, these distributed architectures also introduce significant complexity around networking, security, and observability. As developmen

Peter Barnard

Building Dynamic Aggregate APIs with GraphQL

Kong Logo
EngineeringSeptember 13, 2023

Domain-driven designs are popular in organizations that have complex domain models and wish to organize engineering around them. REST-based architectures are a common choice for implementing the API entry point into these domains. REST-based solu

Rick Spurgeon

How to Design a Scalable Rate Limiting Algorithm with Kong API

Kong Logo
EngineeringJanuary 15, 2021

What is rate limiting? Rate limiting protects your APIs from inadvertent or malicious overuse by limiting how often each user can call the API. Without rate limiting, each user may make a request as often as they like, leading to "spikes" of reques

Guanlan Dai

Guide to API Testing: Understanding the Basics

Kong Logo
EngineeringSeptember 1, 2025

Key Takeaways API testing is crucial for ensuring the reliability, security, and performance of modern applications. Different types of testing, such as functional, security, performance, and integration testing, should be employed to cover all aspe

Adam Bauman

GraphQL vs REST: Key Similarities and Differences Explained

Kong Logo
Learning CenterFebruary 28, 2025

Choosing the right API architecture is crucial for building efficient and scalable applications and the two prominent contenders in this arena are GraphQL and REST, each with its unique set of characteristics and benefits. Understanding the similari

Kong

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

Increase developer productivity, security, and performance at scale with the unified platform for API management, AI gateways, service mesh, and ingress controller.

Sign up for Kong newsletter

    • Platform
    • Kong Konnect
    • Kong Gateway
    • Kong AI Gateway
    • Kong Insomnia
    • Developer Portal
    • Gateway Manager
    • Cloud Gateway
    • Get a Demo
    • Explore More
    • Open Banking API Solutions
    • API Governance Solutions
    • Istio API Gateway Integration
    • Kubernetes API Management
    • API Gateway: Build vs Buy
    • Kong vs Postman
    • Kong vs MuleSoft
    • Kong vs Apigee
    • Documentation
    • Kong Konnect Docs
    • Kong Gateway Docs
    • Kong Mesh Docs
    • Kong AI Gateway
    • Kong Insomnia Docs
    • Kong Plugin Hub
    • Open Source
    • Kong Gateway
    • Kuma
    • Insomnia
    • Kong Community
    • Company
    • About Kong
    • Customers
    • Careers
    • Press
    • Events
    • Contact
    • Pricing
  • Terms
  • Privacy
  • Trust and Compliance
  • © Kong Inc. 2025