---
title: "POST /api/v1/kms/keys"
method: POST
path: "/api/v1/kms/keys"
tags: ["KMS Keys"]
---

# POST /api/v1/kms/keys

`POST /api/v1/kms/keys`

Create KMS key

## Request body

- object
  - `projectId` string, required — The ID of the project to create the key in.
  - `name` string, required — The name of the key to be created. Must be slug-friendly.
  - `description` string — An optional description of the key.
  - `keyUsage` 'encrypt-decrypt' | 'sign-verify' | 'generate-verify-mac' — The type of key to be created, either encrypt-decrypt or sign-verify, based on your intended use for the key.
  - `algorithm` 'aes-256-gcm' | 'aes-128-gcm' | 'RSA_4096' | 'ECC_NIST_P256' | 'ECC_NIST_P384' | 'ECC_NIST_P521' | 'ML_DSA_44' | 'ML_DSA_65' | 'ML_DSA_87' | 'HMAC_SHA_1' | 'HMAC_SHA_224' | 'HMAC_SHA_256' | 'HMAC_SHA_384' | 'HMAC_SHA_512' — The cryptographic algorithm of the key (e.g. aes-256-gcm, RSA_4096, HMAC_SHA_256).
  - `isExportable` boolean — Whether the raw key material can be exported after creation. When set to false, the key can never be exported regardless of permissions. This cannot be changed after creation.

## Response `200`

Default Response

- object
  - `key` object, required
    - `id` string, uuid, required
    - `description` string, nullable
    - `isDisabled` boolean, nullable
    - `orgId` string, uuid, required
    - `name` string, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `projectId` string, nullable
    - `keyUsage` string
    - `kmipMetadata` unknown
    - `isExportable` boolean
    - `version` number
    - `algorithm` string, required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/versions/885aef3e6c11/schema)
