---
title: "Update an Upstream"
method: PATCH
path: "/upstreams/{UpstreamIdOrName}"
tags: ["Upstreams"]
---

# Update an Upstream

`PATCH /upstreams/{UpstreamIdOrName}`

Update an Upstream

## Request body

- Upstream
  - `algorithm` 'consistent-hashing' | 'least-connections' | 'round-robin' | 'latency' — Which load balancing algorithm to use.
  - `client_certificate` object — If set, the certificate to be used as client certificate while TLS handshaking to the upstream server.
    - `id` string
  - `created_at` integer — Unix epoch when the resource was created.
  - `hash_fallback` 'none' | 'consumer' | 'ip' | 'header' | 'cookie' | 'path' | 'query_arg' | 'uri_capture' — What to use as hashing input if the primary `hash_on` does not return a hash (eg. header is missing, or no Consumer identified). Not available if `hash_on` is set to `cookie`.
  - `hash_fallback_header` string — The header name to take the value from as hash input. Only required when `hash_fallback` is set to `header`.
  - `hash_fallback_query_arg` string — The name of the query string argument to take the value from as hash input. Only required when `hash_fallback` is set to `query_arg`.
  - `hash_fallback_uri_capture` string — The name of the route URI capture to take the value from as hash input. Only required when `hash_fallback` is set to `uri_capture`.
  - `hash_on` 'none' | 'consumer' | 'ip' | 'header' | 'cookie' | 'path' | 'query_arg' | 'uri_capture' — What to use as hashing input. Using `none` results in a weighted-round-robin scheme with no hashing.
  - `hash_on_cookie` string — The cookie name to take the value from as hash input. Only required when `hash_on` or `hash_fallback` is set to `cookie`. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.
  - `hash_on_cookie_path` string — The cookie path to set in the response headers. Only required when `hash_on` or `hash_fallback` is set to `cookie`.
  - `hash_on_header` string — The header name to take the value from as hash input. Only required when `hash_on` is set to `header`.
  - `hash_on_query_arg` string — The name of the query string argument to take the value from as hash input. Only required when `hash_on` is set to `query_arg`.
  - `hash_on_uri_capture` string — The name of the route URI capture to take the value from as hash input. Only required when `hash_on` is set to `uri_capture`.
  - `healthchecks` object
    - `active` object
      - `concurrency` integer
      - `headers` object
      - `healthy` object
        - `http_statuses` integer[]
        - `interval` number
        - `successes` integer
      - `http_path` string
      - `https_sni` string
      - `https_verify_certificate` boolean
      - `timeout` number
      - `type` 'tcp' | 'http' | 'https' | 'grpc' | 'grpcs'
      - `unhealthy` object
        - `http_failures` integer
        - `http_statuses` integer[]
        - `interval` number
        - `tcp_failures` integer
        - `timeouts` integer
    - `passive` object
      - `healthy` object
        - `http_statuses` integer[]
        - `successes` integer
      - `type` 'tcp' | 'http' | 'https' | 'grpc' | 'grpcs'
      - `unhealthy` object
        - `http_failures` integer
        - `http_statuses` integer[]
        - `tcp_failures` integer
        - `timeouts` integer
    - `threshold` number
  - `host_header` string — The hostname to be used as `Host` header when proxying requests through Kong.
  - `id` string
  - `name` string — This is a hostname, which must be equal to the `host` of a Service.
  - `slots` integer — The number of slots in the load balancer algorithm. If `algorithm` is set to `round-robin`, this setting determines the maximum number of slots. If `algorithm` is set to `consistent-hashing`, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range `10`-`65536`.
  - `tags` string[] — An optional set of strings associated with the Upstream for grouping and filtering.
  - `updated_at` integer — Unix epoch when the resource was last updated.
  - `use_srv_name` boolean — If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream `Host`.

## Response `200`

Successfully updated Upstream

- Upstream
  - `algorithm` 'consistent-hashing' | 'least-connections' | 'round-robin' | 'latency' — Which load balancing algorithm to use.
  - `client_certificate` object — If set, the certificate to be used as client certificate while TLS handshaking to the upstream server.
    - `id` string
  - `created_at` integer — Unix epoch when the resource was created.
  - `hash_fallback` 'none' | 'consumer' | 'ip' | 'header' | 'cookie' | 'path' | 'query_arg' | 'uri_capture' — What to use as hashing input if the primary `hash_on` does not return a hash (eg. header is missing, or no Consumer identified). Not available if `hash_on` is set to `cookie`.
  - `hash_fallback_header` string — The header name to take the value from as hash input. Only required when `hash_fallback` is set to `header`.
  - `hash_fallback_query_arg` string — The name of the query string argument to take the value from as hash input. Only required when `hash_fallback` is set to `query_arg`.
  - `hash_fallback_uri_capture` string — The name of the route URI capture to take the value from as hash input. Only required when `hash_fallback` is set to `uri_capture`.
  - `hash_on` 'none' | 'consumer' | 'ip' | 'header' | 'cookie' | 'path' | 'query_arg' | 'uri_capture' — What to use as hashing input. Using `none` results in a weighted-round-robin scheme with no hashing.
  - `hash_on_cookie` string — The cookie name to take the value from as hash input. Only required when `hash_on` or `hash_fallback` is set to `cookie`. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.
  - `hash_on_cookie_path` string — The cookie path to set in the response headers. Only required when `hash_on` or `hash_fallback` is set to `cookie`.
  - `hash_on_header` string — The header name to take the value from as hash input. Only required when `hash_on` is set to `header`.
  - `hash_on_query_arg` string — The name of the query string argument to take the value from as hash input. Only required when `hash_on` is set to `query_arg`.
  - `hash_on_uri_capture` string — The name of the route URI capture to take the value from as hash input. Only required when `hash_on` is set to `uri_capture`.
  - `healthchecks` object
    - `active` object
      - `concurrency` integer
      - `headers` object
      - `healthy` object
        - `http_statuses` integer[]
        - `interval` number
        - `successes` integer
      - `http_path` string
      - `https_sni` string
      - `https_verify_certificate` boolean
      - `timeout` number
      - `type` 'tcp' | 'http' | 'https' | 'grpc' | 'grpcs'
      - `unhealthy` object
        - `http_failures` integer
        - `http_statuses` integer[]
        - `interval` number
        - `tcp_failures` integer
        - `timeouts` integer
    - `passive` object
      - `healthy` object
        - `http_statuses` integer[]
        - `successes` integer
      - `type` 'tcp' | 'http' | 'https' | 'grpc' | 'grpcs'
      - `unhealthy` object
        - `http_failures` integer
        - `http_statuses` integer[]
        - `tcp_failures` integer
        - `timeouts` integer
    - `threshold` number
  - `host_header` string — The hostname to be used as `Host` header when proxying requests through Kong.
  - `id` string
  - `name` string — This is a hostname, which must be equal to the `host` of a Service.
  - `slots` integer — The number of slots in the load balancer algorithm. If `algorithm` is set to `round-robin`, this setting determines the maximum number of slots. If `algorithm` is set to `consistent-hashing`, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range `10`-`65536`.
  - `tags` string[] — An optional set of strings associated with the Upstream for grouping and filtering.
  - `updated_at` integer — Unix epoch when the resource was last updated.
  - `use_srv_name` boolean — If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream `Host`.

## Other responses

- `401` — Unauthorized
- `404` — Resource does not exist

## Changes

> 3 revisions in range; 1 not diffed.

- **2024-09-11** `5bd52189d290` — 1 warning
  - deleted the `path` request parameter `UpstreamIdOrName`

[Change history](https://skmtc.dev/kong/apis/kong-enterprise-admin-api/changes/upstreams/:UpstreamIdOrName/patch.md)

---

[API](https://skmtc.dev/kong/apis/kong-enterprise-admin-api.md) · [All operations](https://skmtc.dev/kong/apis/kong-enterprise-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kong/kong-enterprise-admin-api/revisions/5bd52189d290/schema)
