---
title: "Upsert a KeySet"
method: PUT
path: "/key-sets/{KeySetIdOrName}"
tags: ["KeySets"]
---

# Upsert a KeySet

`PUT /key-sets/{KeySetIdOrName}`

Create or Update KeySet using ID or name.

## Request body

- KeySet
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `id` string, nullable
  - `name` string, nullable
  - `tags` string[]
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.

## Response `200`

Successfully upserted KeySet

- KeySet
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `id` string, nullable
  - `name` string, nullable
  - `tags` string[]
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.

## Other responses

- `401` — Unauthorized

## Changes

> 7 revisions in range; 1 not diffed.

- **2025-04-04** `e07a25288f1f` — 2 breaking, 6 info
  - the response property `created_at` became nullable for the status `200`
  - the response property `updated_at` became nullable for the status `200`
  - the request optional property `created_at` became not read-only
  - the request optional property `updated_at` became not read-only
  - …4 more
- **2024-11-26** `99e71588eb61` — 2 breaking, 4 info
  - the response property `id` became nullable for the status `200`
  - the response property `name` became nullable for the status `200`
  - the request optional property `id` became not read-only
  - the request property `id` became nullable
  - …2 more
- **2024-09-11** `5bd52189d290` — 1 warning
  - deleted the `path` request parameter `KeySetIdOrName`

[Change history](https://skmtc.dev/kong/apis/kong-enterprise-admin-api/changes/key-sets/:KeySetIdOrName/put.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/daef3e27adf6/schema)
