---
title: "Create Vault"
method: POST
path: "/v1/event-gateways/{gatewayId}/vaults"
tags: ["Event Gateway Vaults"]
---

# Create Vault

`POST /v1/event-gateways/{gatewayId}/vaults`

Creates a new vault associated with the specified Event Gateway.

## Request body

- union — The typed schema of the vault to modify it.
  - EventGatewayEnvVault — An environment vault.
    - `name` string, required — The name of the vault.
    - `type` 'env', required — The type of the vault.
    - `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.
    - `description` string — A human-readable description of the vault.
    - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
    - `config` object, required — The configuration of the environment vault.
      - `prefix` string, required — The optional prefix for environment variables.
  - EventGatewayKonnectVault — A konnect vault.
    - `name` string, required — The name of the vault.
    - `type` 'konnect', required — The type of the vault.
    - `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.
    - `description` string — A human-readable description of the vault.
    - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

## Response `201`

Created

- union
  - object — An environment vault.
    - `id` string, uuid, required — The unique identifier of the vault.
    - `name` string, required — The name of the vault.
    - `type` 'env', required — The type of the vault.
    - `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.
    - `description` string — A human-readable description of the vault.
    - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
    - `config` object, required — The configuration of the environment vault.
      - `prefix` string, required — The optional prefix for environment variables.
  - object — A konnect vault.
    - `id` string, uuid, required — The unique identifier of the vault.
    - `name` string, required — The name of the vault.
    - `type` 'konnect', required — The type of the vault.
    - `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.
    - `description` string — A human-readable description of the vault.
    - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden

---

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