Create a new route associated with a service

Create a new route associated with a service

post

Path Parameters

service_idstringrequired

ID or name of the related service

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Body

application/json

Route request body

namestring

The name of the route. Route names must be unique, and they are case sensitive. For example, there can be two different routes named “test” and “Test”.

protocolsarray[string]required

An array of the protocols this route should allow

Default:https

Example:tcp

methodsarray[string]

A list of HTTP methods that match this route.

Example:GET

hostsarray[string]

A list of domain names that match this route. Note that the hosts value is case sensitive. With form-encoded, the notation is hosts[]=example.com&hosts[]=foo.test. With JSON, use an Array.

pathsarray[string]

A list of paths that match this route. With form-encoded, the notation is paths[]=/foo&paths[]=/bar. With JSON, use an array. The path can be a regular expression, or a plain text pattern.

headersobject

One or more lists of values indexed by header name that will cause this route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute. When headers contains only one value and that value starts with the special prefix ~*, the value is interpreted as a regular expression.

Show Child Parameters
https_redirect_status_codeintegerrequired

The status code Kong responds with when all properties of a route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS
Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the route is configured to only accept the https protocol. Accepted values are: 426, 301, 302, 307, 308. Default: 426.

Allowed values:426301302307308

Default:426

Example:426

regex_priorityinteger

A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same regex_priority, the older one (lowest created_at) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones). Default: 0.

Default:0

Example:0

strip_pathboolean

When matching a route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.

Default:true

path_handlingstring

Controls how the service path, route path and requested path are combined when sending a request to the upstream. Accepted values are: v0, v1. Default: v0.

Allowed values:v1v0

Example:v0

preserve_hostbooleanrequired

When matching a route via one of the hosts domain names, use the request host header in the upstream request headers. If set to false, the upstream Host header will be that of the service’s host.

Default:true

request_bufferingbooleanrequired

Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.

Default:true

response_bufferingbooleanrequired

Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.

Default:true

snisarray[string]

A list of SNIs that match this route when using stream routing.

sourcesarray[object]

A list of IP sources of incoming connections that match this route when using stream routing. Each entry is an object with fields “ip” (optionally in CIDR range notation) and/or “port”.

Show Child Parameters
destinationsarray[object]

A list of IP destinations of incoming connections that match this route when using stream routing. Each entry is an object with fields “ip” (optionally in CIDR range notation) and/or “port”.

Show Child Parameters
tagsarray[string]

An optional set of strings associated with the route for grouping and filtering.

serviceobject

The service this route is associated to. This is where the route proxies traffic to. With form-encoded, the notation is service.id= or service.name=. With JSON, use “service:{id:<service id>} or service:{name:<service name>}.

Show Child Parameters

Response

application/json

Successfully created route

Route

Route entities define rules to match client requests. Every request matching a given route will be proxied to its associated service.

created_atinteger

Unix epoch when the resource was created.

destinationsarray[object]

A list of IP destinations of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

headersobject

One or more lists of values indexed by header name that will cause this route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute. When headers contains only one value and that value starts with the special prefix ~*, the value is interpreted as a regular expression.

hostsarray[string]

A list of domain names that match this route. Note that the hosts value is case sensitive.

Example:foo.example.com

https_redirect_status_codeinteger

The status code Kong responds with when all properties of a route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the route is configured to only accept the https protocol.

Default:426

idstring

Example:56c4566c-14cc-4132-9011-4139fcbbe50a

methodsarray[string]

A list of HTTP methods that match this route.

namestring

The name of the route. Route names must be unique, and they are case sensitive. For example, there can be two different routes named test and Test.

path_handlingstring

Controls how the service path, route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior.

Default:v0

pathsarray[string]

A list of paths that match this route.

preserve_hostboolean

When matching a route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the service’s host.

Default:false

protocolsarray[string]

An array of the protocols this route should allow. See the route Object section for a list of accepted protocols. When set to only https, HTTP requests are answered with an upgrade error. When set to only http, HTTPS requests are answered with an error.

Default:http, https

regex_priorityinteger

A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same regex_priority, the older one (lowest created_at) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones).

Default:0

request_bufferingboolean

Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding.

Default:true

response_bufferingboolean

Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding.

Default:true

serviceobject

The service this route is associated to. This is where the route proxies traffic to.

* Additional properties are NOT allowed.
Show Child Parameters
snisarray[string]

A list of SNIs that match this route when using stream routing.

sourcesarray[object]

A list of IP sources of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

strip_pathboolean

When matching a route via one of the paths, strip the matching prefix from the upstream request URL.

Default:true

tagsarray[string]

An optional set of strings associated with the route for grouping and filtering.

updated_atinteger

Unix epoch when the resource was last updated.

post/runtime-groups/{runtimeGroupId}/core-entities/services/{service_id}/routes

Body

{ "name": "my-route", "protocols": [ "http", "https" ], "methods": [ "GET", "POST" ], "hosts": [ "example.com", "foo.test" ], "paths": [ "/foo", "/bar" ], "headers": { "x-my-header": [ "foo", "bar" ], "x-another-header": [ "bla" ] }, "https_redirect_status_code": 426, "regex_priority": 0, "strip_path": true, "path_handling": "v0", "preserve_host": false, "request_buffering": true, "response_buffering": true, "tags": [ "user-level", "low-priority" ], "service": { "id": "af8330d3-dbdc-48bd-b1be-55b98608834b" } }
 
application/json

Delete a a route associated with a service

Delete a a route associated with a a service using ID or name.

delete

Path Parameters

service_idstringrequired

ID or name of the service to lookup

Example:7fca84d6-7d37-4a74-a7b0-93e576089a41

route_idstringrequired

The unique identifier or the name of the route to retrieve.

Example:e94215b0-9198-42ce-bf0b-98afff31b2a7

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Response

204

Successfully deleted route or the resource didn’t exist

delete/runtime-groups/{runtimeGroupId}/core-entities/services/{service_id}/routes/{route_id}
 
204

Get a route associated with a service

Get a route associated with a service using ID or name.

get

Query Parameters

offsetstring

Offset from which to return the next set of resources. Use the value of the ‘offset’ field from the response of a list operation as input here to paginate through all the resources

sizeinteger

Number of resources to be returned.

Default:100

>= 1<= 1000

tagsstring

A list of tags to filter the list of resources on. Multiple tags can be concatenated using ‘,’ to mean AND or using ‘/’ to mean OR.

Example:tag1,tag2

Path Parameters

service_idstringrequired

ID or name of the service to lookup

Example:7fca84d6-7d37-4a74-a7b0-93e576089a41

route_idstringrequired

The unique identifier or the name of the route to retrieve.

Example:e94215b0-9198-42ce-bf0b-98afff31b2a7

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Response

application/json

Successfully fetched route

Route

Route entities define rules to match client requests. Every request matching a given route will be proxied to its associated service.

created_atinteger

Unix epoch when the resource was created.

destinationsarray[object]

A list of IP destinations of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

headersobject

One or more lists of values indexed by header name that will cause this route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute. When headers contains only one value and that value starts with the special prefix ~*, the value is interpreted as a regular expression.

hostsarray[string]

A list of domain names that match this route. Note that the hosts value is case sensitive.

Example:foo.example.com

https_redirect_status_codeinteger

The status code Kong responds with when all properties of a route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the route is configured to only accept the https protocol.

Default:426

idstring

Example:56c4566c-14cc-4132-9011-4139fcbbe50a

methodsarray[string]

A list of HTTP methods that match this route.

namestring

The name of the route. Route names must be unique, and they are case sensitive. For example, there can be two different routes named test and Test.

path_handlingstring

Controls how the service path, route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior.

Default:v0

pathsarray[string]

A list of paths that match this route.

preserve_hostboolean

When matching a route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the service’s host.

Default:false

protocolsarray[string]

An array of the protocols this route should allow. See the route Object section for a list of accepted protocols. When set to only https, HTTP requests are answered with an upgrade error. When set to only http, HTTPS requests are answered with an error.

Default:http, https

regex_priorityinteger

A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same regex_priority, the older one (lowest created_at) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones).

Default:0

request_bufferingboolean

Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding.

Default:true

response_bufferingboolean

Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding.

Default:true

serviceobject

The service this route is associated to. This is where the route proxies traffic to.

* Additional properties are NOT allowed.
Show Child Parameters
snisarray[string]

A list of SNIs that match this route when using stream routing.

sourcesarray[object]

A list of IP sources of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

strip_pathboolean

When matching a route via one of the paths, strip the matching prefix from the upstream request URL.

Default:true

tagsarray[string]

An optional set of strings associated with the route for grouping and filtering.

updated_atinteger

Unix epoch when the resource was last updated.

get/runtime-groups/{runtimeGroupId}/core-entities/services/{service_id}/routes/{route_id}
 
application/json

Upsert a route associated with a service

Create or Update a route associated with a service using ID or name.

put

Path Parameters

service_idstringrequired

ID or name of the service to lookup

Example:7fca84d6-7d37-4a74-a7b0-93e576089a41

route_idstringrequired

The unique identifier or the name of the route to retrieve.

Example:e94215b0-9198-42ce-bf0b-98afff31b2a7

runtimeGroupIdstringrequired

The ID of your runtime group. This variable is available in the Konnect manager

Example:9524ec7d-36d9-465d-a8c5-83a3c9390458

Body

application/json

Route request body

namestring

The name of the route. Route names must be unique, and they are case sensitive. For example, there can be two different routes named “test” and “Test”.

protocolsarray[string]required

An array of the protocols this route should allow

Default:https

Example:tcp

methodsarray[string]

A list of HTTP methods that match this route.

Example:GET

hostsarray[string]

A list of domain names that match this route. Note that the hosts value is case sensitive. With form-encoded, the notation is hosts[]=example.com&hosts[]=foo.test. With JSON, use an Array.

pathsarray[string]

A list of paths that match this route. With form-encoded, the notation is paths[]=/foo&paths[]=/bar. With JSON, use an array. The path can be a regular expression, or a plain text pattern.

headersobject

One or more lists of values indexed by header name that will cause this route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute. When headers contains only one value and that value starts with the special prefix ~*, the value is interpreted as a regular expression.

Show Child Parameters
https_redirect_status_codeintegerrequired

The status code Kong responds with when all properties of a route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS
Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the route is configured to only accept the https protocol. Accepted values are: 426, 301, 302, 307, 308. Default: 426.

Allowed values:426301302307308

Default:426

Example:426

regex_priorityinteger

A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same regex_priority, the older one (lowest created_at) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones). Default: 0.

Default:0

Example:0

strip_pathboolean

When matching a route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.

Default:true

path_handlingstring

Controls how the service path, route path and requested path are combined when sending a request to the upstream. Accepted values are: v0, v1. Default: v0.

Allowed values:v1v0

Example:v0

preserve_hostbooleanrequired

When matching a route via one of the hosts domain names, use the request host header in the upstream request headers. If set to false, the upstream Host header will be that of the service’s host.

Default:true

request_bufferingbooleanrequired

Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.

Default:true

response_bufferingbooleanrequired

Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.

Default:true

snisarray[string]

A list of SNIs that match this route when using stream routing.

sourcesarray[object]

A list of IP sources of incoming connections that match this route when using stream routing. Each entry is an object with fields “ip” (optionally in CIDR range notation) and/or “port”.

Show Child Parameters
destinationsarray[object]

A list of IP destinations of incoming connections that match this route when using stream routing. Each entry is an object with fields “ip” (optionally in CIDR range notation) and/or “port”.

Show Child Parameters
tagsarray[string]

An optional set of strings associated with the route for grouping and filtering.

serviceobject

The service this route is associated to. This is where the route proxies traffic to. With form-encoded, the notation is service.id= or service.name=. With JSON, use “service:{id:<service id>} or service:{name:<service name>}.

Show Child Parameters

Response

application/json

Successfully upserted route

Route

Route entities define rules to match client requests. Every request matching a given route will be proxied to its associated service.

created_atinteger

Unix epoch when the resource was created.

destinationsarray[object]

A list of IP destinations of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

headersobject

One or more lists of values indexed by header name that will cause this route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute. When headers contains only one value and that value starts with the special prefix ~*, the value is interpreted as a regular expression.

hostsarray[string]

A list of domain names that match this route. Note that the hosts value is case sensitive.

Example:foo.example.com

https_redirect_status_codeinteger

The status code Kong responds with when all properties of a route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the route is configured to only accept the https protocol.

Default:426

idstring

Example:56c4566c-14cc-4132-9011-4139fcbbe50a

methodsarray[string]

A list of HTTP methods that match this route.

namestring

The name of the route. Route names must be unique, and they are case sensitive. For example, there can be two different routes named test and Test.

path_handlingstring

Controls how the service path, route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior.

Default:v0

pathsarray[string]

A list of paths that match this route.

preserve_hostboolean

When matching a route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the service’s host.

Default:false

protocolsarray[string]

An array of the protocols this route should allow. See the route Object section for a list of accepted protocols. When set to only https, HTTP requests are answered with an upgrade error. When set to only http, HTTPS requests are answered with an error.

Default:http, https

regex_priorityinteger

A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same regex_priority, the older one (lowest created_at) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones).

Default:0

request_bufferingboolean

Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding.

Default:true

response_bufferingboolean

Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding.

Default:true

serviceobject

The service this route is associated to. This is where the route proxies traffic to.

* Additional properties are NOT allowed.
Show Child Parameters
snisarray[string]

A list of SNIs that match this route when using stream routing.

sourcesarray[object]

A list of IP sources of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

strip_pathboolean

When matching a route via one of the paths, strip the matching prefix from the upstream request URL.

Default:true

tagsarray[string]

An optional set of strings associated with the route for grouping and filtering.

updated_atinteger

Unix epoch when the resource was last updated.

put/runtime-groups/{runtimeGroupId}/core-entities/services/{service_id}/routes/{route_id}

Body

{ "name": "my-route", "protocols": [ "http", "https" ], "methods": [ "GET", "POST" ], "hosts": [ "example.com", "foo.test" ], "paths": [ "/foo", "/bar" ], "headers": { "x-my-header": [ "foo", "bar" ], "x-another-header": [ "bla" ] }, "https_redirect_status_code": 426, "regex_priority": 0, "strip_path": true, "path_handling": "v0", "preserve_host": false, "request_buffering": true, "response_buffering": true, "tags": [ "user-level", "low-priority" ], "service": { "id": "af8330d3-dbdc-48bd-b1be-55b98608834b" } }
 
application/json

Plugins

Plugins