---
title: "Update a route"
url: "https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd/operations/upsert-route"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd.md

# Update a route

`PUT` `/runtime-groups/{runtimeGroupId}/core-entities/routes/{route_id}`

Operation ID: `upsert-route`

Create or Update route using ID or name.

## Path parameters

- `runtimeGroupId` (string, required) - The ID of your runtime group. This variable is available in the Konnect manager
- `route_id` (string, required)

## Request body

Content types: `application/json`

## Responses

- `200` - Successfully upserted route
- `400` - Invalid route

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Konnect Runtime Groups Configuration
  version: 0.0.1
servers:
  - url: https://us.api.konghq.com/v2
    description: United-States Production region
  - url: https://eu.api.konghq.com/v2
    description: Europe Production region
  - url: https://au.api.konghq.com/v2
    description: Australia Production region
  - url: https://me.api.konghq.com/v2
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v2
    description: India Production region
  - url: https://sg.api.konghq.com/v2
    description: Singapore Production region
paths:
  /runtime-groups/{runtimeGroupId}/core-entities/routes/{route_id}:
    parameters:
      - name: runtimeGroupId
        in: path
        description: The ID of your runtime group. This variable is available in the
          Konnect manager
        required: true
        schema:
          type: string
          example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      - name: route_id
        in: path
        required: true
        schema:
          type: string
    put:
      operationId: upsert-route
      summary: Update a route
      description: Create or Update route using ID or name.
      requestBody:
        $ref: "#/components/requestBodies/route-request"
      responses:
        "200":
          description: Successfully upserted route
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Route"
        "400":
          description: Invalid route
          content:
            application/json:
              schema:
                type: object
      tags:
        - Routes
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  requestBodies:
    route-request:
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                description: >
                  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”.
                type: string
              protocols:
                description: An array of the protocols this route should allow
                type: array
                items:
                  type: string
                  default: https
                  example: tcp
              methods:
                description: |
                  A list of HTTP methods that match this route.
                type: array
                items:
                  type: string
                  example: GET
              hosts:
                description: 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.
                type: array
                items:
                  type: string
              paths:
                description: "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. "
                type: array
                items:
                  type: string
              headers:
                description: "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."
                type: object
                properties:
                  x-my-header:
                    type: array
                    items:
                      type: string
                  x-another-header:
                    type: array
                    items:
                      type: string
              https_redirect_status_code:
                description: >-
                  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`.
                type: integer
                example: 426
                default: 426
                enum:
                  - 426
                  - 301
                  - 302
                  - 307
                  - 308
              regex_priority:
                description: "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`."
                type: integer
                example: 0
                default: 0
              strip_path:
                description: "When matching a route via one of the paths, strip the matching
                  prefix from the upstream request URL. Default: `true`."
                type: boolean
                default: true
              path_handling:
                description: "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`."
                type: string
                example: v0
                enum:
                  - v1
                  - v0
              preserve_host:
                description: 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.
                type: boolean
                default: true
              request_buffering:
                description: >
                  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.
                type: boolean
                default: true
              response_buffering:
                description: >
                  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`.
                type: boolean
                default: true
              snis:
                description: >
                  A list of SNIs that match this route when using stream routing.
                type: array
                items:
                  type: string
              sources:
                description: >
                  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”.
                type: array
                items:
                  type: object
                  properties:
                    ip:
                      type: string
                      example: 10.1.0.0/16
                    port:
                      type: integer
                      example: 1234
              destinations:
                description: >
                  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”.
                type: array
                items:
                  type: object
                  properties:
                    ip:
                      type: string
                      example: 0.1.0.0/16
                    port:
                      type: integer
              tags:
                description: >
                  An optional set of strings associated with the route for
                  grouping and filtering.
                type: array
                items:
                  type: string
              service:
                description: The service this route is associated to. This is where the route
                  proxies traffic to. With form-encoded, the notation is
                  service.id=<service id> or service.name=<service name>. With
                  JSON, use “`service:{id:<service id>}` or
                  `service:{name:<service name>}`.
                type: object
                properties:
                  id:
                    type: string
                    example: af8330d3-dbdc-48bd-b1be-55b98608834b
            required:
              - protocols
              - https_redirect_status_code
              - preserve_host
              - request_buffering
              - response_buffering
            x-examples:
              Example 1:
                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
                snis:
                  - foo.test
                  - example.com
                sources:
                  - ip: 10.1.0.0/16
                    port: 1234
                  - ip: 10.2.2.2
                  - port: 9123
                destinations:
                  - ip: 10.1.0.0/16
                    port: 1234
                  - ip: 10.2.2.2
                  - port: 9123
                tags:
                  - user-level
                  - low-priority
                service:
                  id: af8330d3-dbdc-48bd-b1be-55b98608834b
          examples:
            Create a route:
              value:
                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
      description: Route request body
  schemas:
    Route:
      description: Route entities define rules to match client requests. Every request
        matching a given route will be proxied to its associated service.
      type: object
      properties:
        created_at:
          description: Unix epoch when the resource was created.
          type: integer
        destinations:
          description: 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.
          type: array
          items:
            type: object
            properties: {}
        headers:
          description: "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."
          type: object
        hosts:
          description: A list of domain names that match this route. Note that the hosts
            value is case sensitive.
          type: array
          items:
            type: string
            example: foo.example.com
        https_redirect_status_code:
          description: "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."
          type: integer
          default: 426
        id:
          type: string
          example: 56c4566c-14cc-4132-9011-4139fcbbe50a
        methods:
          description: A list of HTTP methods that match this route.
          type: array
          items:
            type: string
        name:
          description: 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.
          type: string
        path_handling:
          description: 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.
          type: string
          default: v0
        paths:
          description: A list of paths that match this route.
          type: array
          items:
            type: string
        preserve_host:
          description: 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`.
          type: boolean
          default: false
        protocols:
          description: An array of the protocols this route should allow. See the [route
            Object](#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.
          type: array
          items:
            type: string
          default:
            - http
            - https
        regex_priority:
          description: 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).
          type: integer
          default: 0
        request_buffering:
          description: 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.
          type: boolean
          default: true
        response_buffering:
          description: 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.
          type: boolean
          default: true
        service:
          description: The service this route is associated to. This is where the route
            proxies traffic to.
          type: object
          additionalProperties: false
          properties:
            id:
              type: string
        snis:
          description: A list of SNIs that match this route when using stream routing.
          type: array
          items:
            type: string
        sources:
          description: 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.
          type: array
          items:
            type: object
            properties: {}
        strip_path:
          description: When matching a route via one of the `paths`, strip the matching
            prefix from the upstream request URL.
          type: boolean
          default: true
        tags:
          description: An optional set of strings associated with the route for grouping
            and filtering.
          type: array
          items:
            type: string
        updated_at:
          description: Unix epoch when the resource was last updated.
          type: integer
      example:
        hosts:
          - foo.example.com
          - foo.example.us
        id: 56c4566c-14cc-4132-9011-4139fcbbe50a
        name: example-route
        paths:
          - /v1
          - /v2
        service:
          id: bd380f99-659d-415e-b0e7-72ea05df3218
      title: Route
  securitySchemes:
    konnectAccessToken:
      type: http
      scheme: bearer
      description: >-
        The Konnect access token is meant to be used by the Konnect dashboard
        and the decK CLI to

        authenticate with.
    personalAccessToken:
      type: http
      scheme: bearer
      description: The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs. You can generate a Personal
        Access Token (PAT) from the personal access token page in the Konnect
        dashboard.
```
