---
title: "Upsert a Vault"
method: PUT
path: "/{workspace}/vaults/{VaultIdOrPrefix}"
tags: ["Vaults"]
---

# Upsert a Vault

`PUT /{workspace}/vaults/{VaultIdOrPrefix}`

Create or Update Vault using ID or prefix.

## Path parameters

- `workspace` string, required

## Request body

- Vault — Vault entities are used to configure different Vault connectors. Examples of Vaults are Environment Variables, Hashicorp Vault and AWS Secrets Manager. Configuring a Vault allows referencing the secrets with other entities. For example a certificate entity can store a reference to a certificate and key, stored in a vault, instead of storing the certificate and key within the entity. This allows a proper separation of secrets and configuration and prevents secret sprawl.
  - `config` object, nullable — The configuration properties for the Vault which can be found on the vaults' documentation page.
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `description` string, nullable — The description of the Vault entity.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `name` string, required — The name of the Vault that's going to be added. Currently, the Vault implementation must be installed in every Kong instance.
  - `prefix` string, required — The unique prefix (or identifier) for this Vault configuration. The prefix is used to load the right Vault configuration and implementation when referencing secrets with the other entities.
  - `tags` string[], nullable — An optional set of strings associated with the Vault for grouping and filtering.
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.

## Response `200`

Successfully upserted Vault

- Vault — Vault entities are used to configure different Vault connectors. Examples of Vaults are Environment Variables, Hashicorp Vault and AWS Secrets Manager. Configuring a Vault allows referencing the secrets with other entities. For example a certificate entity can store a reference to a certificate and key, stored in a vault, instead of storing the certificate and key within the entity. This allows a proper separation of secrets and configuration and prevents secret sprawl.
  - `config` object, nullable — The configuration properties for the Vault which can be found on the vaults' documentation page.
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `description` string, nullable — The description of the Vault entity.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `name` string, required — The name of the Vault that's going to be added. Currently, the Vault implementation must be installed in every Kong instance.
  - `prefix` string, required — The unique prefix (or identifier) for this Vault configuration. The prefix is used to load the right Vault configuration and implementation when referencing secrets with the other entities.
  - `tags` string[], nullable — An optional set of strings associated with the Vault for grouping and filtering.
  - `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)
