Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Kong Routes API

Route entities define rules to match client requests. Each route is associated with a service, and a service may have multiple routes associated to it. Every request matching a given route will be proxied to the associated service. You need at least one matching rule that applies to the protocol being matched by the route.The combination of routes and services, and the separation of concerns between them, offers a powerful routing mechanism with which it is possible to define fine-grained entrypoints in Kong Gateway leading to different upstream services of your infrastructure.Depending on the protocol, one of the following attributes must be set:- `http`: At least one of `methods`, `hosts`, `headers`, or `paths`- `https`: At least one of `methods`, `hosts`, `headers`, `paths`, or `snis`- `tcp`: At least one of `sources` or `destinations`- `tls`: at least one of `sources`, `destinations`, or `snis`- `tls_passthrough`: set `snis`- `grpc`: At least one of `hosts`, `headers`, or `paths`- `grpcs`: At least one of `hosts`, `headers`, `paths`, or `snis`- `ws`: At least one of `hosts`, `headers`, or `paths`- `wss`: At least one of `hosts`, `headers`, `paths`, or `snis` A route can't have both `tls` and `tls_passthrough` protocols at same time. Learn more about the router:- [Configure routes using expressions](https://developer.konghq.com/gateway/routing/expressions/)

Kong Routes API is one of 139 APIs that Kong publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

This API exposes 1 JSON Schema definition.

Tagged areas include Routes. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, a JSON-LD context, a GitHub repository, an API reference, authentication docs, and 1 JSON Schema.

This API exposes 18 operations across 8 paths, and defines 9 schemas. It is described by OpenAPI 3.1.0, at version 3.14.0.

Requests are made against a single base URL, {protocol}://{hostname}:{port}{path}.

18 operations 8 paths 9 schemas 4 DELETE6 GET4 POST4 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.1.0
API Version
3.14.0
Base URL
https://konghq.com/
Authentication
API Key
Contact
License
Resource Areas
1

Authentication & Security 1

Kong Routes API declares 1 security scheme for authenticating requests. An API key is passed in the header as Kong-Admin-Token (adminToken). By default, every request must be authenticated.

Paths & Operations 18

Across 8 paths, the API surfaces 18 operations — 4 DELETE, 6 GET, 4 POST, 4 PUT. Each is listed below with its method, path, parameters, and response codes.

Routes 18

Route entities define rules to match client requests. Each route is associated with a service, and a service may have multiple routes associated to it. Every request matching a gi…

POST
/{workspace}/routes
Create a new Route
create-route 1 param body → 201401
POST
/{workspace}/routes#RouteExpression
Create a new Route
create-route-RouteExpression 1 param body → 201401
DELETE
/{workspace}/routes/{RouteIdOrName}
Delete a Route
delete-route 3 params → 204401
GET
/{workspace}/routes/{RouteIdOrName}
Get a Route
get-route 2 params → 200401404
PUT
/{workspace}/routes/{RouteIdOrName}
Upsert a Route
upsert-route 2 params body → 200401
DELETE
/{workspace}/routes/{RouteIdOrName}#RouteExpression
Delete a Route
delete-route-RouteExpression 3 params → 204401
GET
/{workspace}/routes/{RouteIdOrName}#RouteExpression
Get a Route
get-route-RouteExpression 2 params → 200401404
PUT
/{workspace}/routes/{RouteIdOrName}#RouteExpression
Upsert a Route
upsert-route-RouteExpression 2 params body → 200401
GET
/v2/control-planes/{controlPlaneId}/core-entities/routes
List all Routes
list-route 6 params → 200401
POST
/v2/control-planes/{controlPlaneId}/core-entities/routes
Create a new Route
create-route 1 param body → 201401
DELETE
/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}
Delete a Route
delete-route 3 params → 204401
GET
/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}
Get a Route
get-route 2 params → 200401404
PUT
/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}
Upsert a Route
upsert-route 2 params body → 200401
GET
/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes
List all Routes associated with a Service
list-route-with-service 5 params → 200
POST
/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes
Create a new Route associated with a Service
create-route-with-service 2 params body → 201
DELETE
/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes/{RouteId}
Delete a a Route associated with a Service
delete-route-with-service 3 params → 204
GET
/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes/{RouteId}
Get a Route associated with a Service
get-route-with-service 3 params → 200404
PUT
/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes/{RouteId}
Upsert a Route associated with a Service
upsert-route-with-service 3 params body → 200

Schemas 9

The contract defines 9 schemas that model the data the API accepts and returns. The most detailed are RouteJson (21 properties), RouteJson_2 (21 properties), RouteExpression (15 properties), RouteExpression_2 (15 properties). Each schema is shown below with its type and property counts.

RouteWithoutParents
RouteExpression_2
object
Route entities define rules to match client requests. Each Route is associated with a Service, and a Service may have multiple Routes associated to it. Every r…
15 properties
RouteJson
object
Route entities define rules to match client requests. Each Route is associated with a Service, and a Service may have multiple Routes associated to it. Every r…
21 properties
Route
PaginationNextResponse
string
URI to the next page (may be null)
RouteJson_2
object
Route entities define rules to match client requests. Each Route is associated with a Service, and a Service may have multiple Routes associated to it. Every r…
21 properties
RouteExpression
object
Route entities define rules to match client requests. Each Route is associated with a Service, and a Service may have multiple Routes associated to it. Every r…
15 properties
PaginationOffsetResponse
string
Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page
GatewayUnauthorizedError
object
2 properties 2 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

kong-routes-api-openapi.yml Raw ↑

Other APIs Kong publishes across the network.

Kong Gateway
Kong AI Gateway
Kong Agent Gateway
Kong MCP Registry
Kong Context Mesh
Kong Mesh
Kong Insomnia
Kong ACLs API
Kong Add-Ons API
Kong API API
Kong API Attributes API
Kong API Documentation API