---
title: "Upsert a Vault"
url: "https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1/operations/upsert-vault"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1.md

# Upsert a Vault

`PUT` `/control-planes/{controlPlaneId}/core-entities/vaults/{VaultId}`

Operation ID: `upsert-vault`

Create or Update Vault using ID or prefix.

## Path parameters

- `VaultId` (string, required) - ID of the Vault to lookup
- `controlPlaneId` (string, uuid, required) - The UUID of your control plane. This variable is available in the Konnect manager.

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Successfully upserted Vault
- `401` - Unauthorized

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Konnect Control Planes Configuration
  version: 3.14.0
servers:
  - url: https://us.api.konghq.com/v2
    description: United-States Production region
  - url: https://eu.api.konghq.com/v2
    description: Europe Production region
  - url: https://au.api.konghq.com/v2
    description: Australia Production region
  - url: https://me.api.konghq.com/v2
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v2
    description: India Production region
  - url: https://sg.api.konghq.com/v2
    description: Singapore Production region
paths:
  /control-planes/{controlPlaneId}/core-entities/vaults/{VaultId}:
    parameters:
      - $ref: "#/components/parameters/VaultId"
      - $ref: "#/components/parameters/controlPlaneId"
    put:
      operationId: upsert-vault
      summary: Upsert a Vault
      description: Create or Update Vault using ID or prefix.
      requestBody:
        description: Description of the Vault
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Vault"
      responses:
        "200":
          description: Successfully upserted Vault
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Vault"
        "401":
          $ref: "#/components/responses/HTTP401Error"
      tags:
        - Vaults
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    VaultId:
      description: ID of the Vault to lookup
      example: 9d4d6d19-77c6-428e-a965-9bc9647633e9
      in: path
      name: VaultId
      required: true
      schema:
        type: string
    controlPlaneId:
      name: controlPlaneId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The UUID of your control plane. This variable is available in the
        Konnect manager.
  schemas:
    Vault:
      description: 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.
      type: object
      properties:
        config:
          description: The configuration properties for the Vault which can be found on
            the vaults' documentation page.
          type: object
          additionalProperties: true
          nullable: true
        created_at:
          description: Unix epoch when the resource was created.
          type: integer
          nullable: true
        description:
          description: The description of the Vault entity.
          type: string
          nullable: true
        id:
          description: A string representing a UUID (universally unique identifier).
          type: string
          nullable: true
        managed_by:
          description: Arbitrary JSON data for client responsible for managing the entity.
            Konnect only field, not synced to the Gateway.
          type: object
          additionalProperties: true
          nullable: true
        name:
          description: The name of the Vault that's going to be added. Currently, the
            Vault implementation must be installed in every Kong instance.
          type: string
        prefix:
          description: 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.
          type: string
        tags:
          description: An optional set of strings associated with the Vault for grouping
            and filtering.
          type: array
          items:
            description: A string representing a tag.
            type: string
          nullable: true
        updated_at:
          description: Unix epoch when the resource was last updated.
          type: integer
          nullable: true
      example:
        config:
          prefix: ENV_PREFIX
        description: environment variable based vault
        id: 2747d1e5-8246-4f65-a939-b392f1ee17f8
        name: env
        prefix: env
        tags:
          - foo
          - bar
      additionalProperties: false
      required:
        - name
        - prefix
    GatewayUnauthorizedError:
      type: object
      properties:
        message:
          type: string
        status:
          type: integer
      required:
        - message
        - status
  responses:
    HTTP401Error:
      description: Unauthorized
      content:
        application/json:
          examples:
            DuplicateApiKey:
              summary: Duplicate API key found
              value:
                message: Duplicate API key found
                status: 401
            InvalidAuthCred:
              summary: Invalid authentication credentials
              value:
                message: Unauthorized
                status: 401
            NoAPIKey:
              summary: No API key found
              value:
                message: No API key found in request
                status: 401
          schema:
            $ref: "#/components/schemas/GatewayUnauthorizedError"
  securitySchemes:
    konnectAccessToken:
      type: http
      scheme: bearer
      description: The Konnect access token is meant to be used by the Konnect
        dashboard and the decK CLI to authenticate with.
    personalAccessToken:
      type: http
      scheme: bearer
      description: The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs. You can generate a Personal
        Access Token (PAT) from the personal access token page in the Konnect
        dashboard.
```
