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

# Upsert a KeySet

`PUT /{workspace}/key-sets/{KeySetIdOrName}`

Create or Update KeySet using ID or name.

## Path parameters

- `workspace` string, required

## Request body

- KeySet
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `name` string, nullable — The name to associate with the given key-set.
  - `tags` string[], nullable — A set of strings representing tags.
  - `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 — A string representing a UUID (universally unique identifier).
  - `name` string, nullable — The name to associate with the given key-set.
  - `tags` string[], nullable — A set of strings representing tags.
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.

## Other responses

- `401` — Unauthorized

---

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