---
title: "Update a realm"
method: PATCH
path: "/v1/realms/{realmId}"
tags: ["Realms"]
---

# Update a realm

`PATCH /v1/realms/{realmId}`

Update a realm's details. Any consumers already cached in a running Gateway will not be affected body
the changes to the Realm until `ttl` minutes have passed.

## Request body

- ConsumerRealmUpdateRequest
  - `name` string, nullable
  - `allowed_control_planes` string[] — List of control plane ids that are allowed to use the realm. This is used when `allow_all_control_planes` value is set to false.
  - `allow_all_control_planes` boolean — Allow all control planes to use the realm. When this value is set it takes precedence on `allowed_control_planes`.
  - `consumer_groups` string[] — A list of consumer groups to automatically add to any consumers created within this Realm. If `consumer_groups` are provided on the Consumer object _and_ on the Realm, the Consumer will be placed in all defined consumer groups.
  - `ttl` integer — The time in minutes that the Consumer will be cached in memory on a running Gateway if it is successfully loaded from Konnect.
  - `negative_ttl` integer — If a running Gateway triggers a lookup for a Consumer that cannot be authenticated this realm, a `negative_ttl` is set. The Gateway will not try to lookup the Consumer in Konnect for `negative_ttl` minutes. A Consumer will be cached for `negative_ttl` if they do not exist in the Realm, or if the provided credentials are invalid.

## Response `200`

success

- ConsumerRealm
  - `id` string, required
  - `name` string, required
  - `ttl` integer, required — The time in minutes that the Consumer will be cached in memory on a running Gateway if it is successfully loaded from Konnect.
  - `negative_ttl` integer, required — If a running Gateway triggers a lookup for a Consumer that cannot be authenticated this realm, a `negative_ttl` is set. The Gateway will not try to lookup the Consumer in Konnect for `negative_ttl` minutes. A Consumer will be cached for `negative_ttl` if they do not exist in the Realm, or if the provided credentials are invalid.
  - `consumer_groups` string[], required — A list of consumer groups to automatically add to any consumers created within this Realm. If `consumer_groups` are provided on the Consumer object _and_ on the Realm, the Consumer will be placed in all defined consumer groups.
  - `allowed_control_planes` string[], required — List of control plane ids that are allowed to use the realm. This is used when `allow_all_control_planes` value is set to false.
  - `allow_all_control_planes` boolean, required — Allow all control planes to use the realm. When this value is set it takes precedence on `allowed_control_planes`.
  - `created_at` string, date-time, required — An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time, required — An ISO-8601 timestamp representation of entity update date.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/kong/apis/konnect-api.md) · [All operations](https://skmtc.net/kong/apis/konnect-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api/versions/06734a9c491f/schema)
