---
title: "POST /create-classic-key"
method: POST
path: "/create-classic-key"
tags: ["v2"]
---

# POST /create-classic-key

`POST /create-classic-key`

## Request body

- CreateClassicKey — CreateClassicKey is a command that creates classic key
  - `alg` string, required — Classic Key type; options: [AES128GCM, AES256GCM, AES128SIV, AES256SIV, RSA1024, RSA2048, RSA3072, RSA4096, EC256, EC384, GPG]
  - `auto-rotate` string — Whether to automatically rotate every rotation_interval days, or disable existing automatic rotation [true/false]
  - `cert-file-data` string — Certificate in a PEM format.
  - `certificate-common-name` string — Common name for the generated certificate. Relevant only for generate-self-signed-certificate.
  - `certificate-country` string — Country name for the generated certificate. Relevant only for generate-self-signed-certificate.
  - `certificate-digest-algo` string — Digest algorithm to be used for the certificate key signing.
  - `certificate-format` string
  - `certificate-locality` string — Locality for the generated certificate. Relevant only for generate-self-signed-certificate.
  - `certificate-organization` string — Organization name for the generated certificate. Relevant only for generate-self-signed-certificate.
  - `certificate-province` string — Province name for the generated certificate. Relevant only for generate-self-signed-certificate.
  - `certificate-ttl` integer — TTL in days for the generated certificate. Required only for generate-self-signed-certificate.
  - `conf-file-data` string — The csr config data in base64 encoding
  - `delete_protection` string — Protection from accidental deletion of this object [true/false]
  - `description` string — Description of the object
  - `expiration-event-in` string[] — How many days before the expiration of the certificate would you like to be notified.
  - `generate-self-signed-certificate` boolean — Whether to generate a self signed certificate with the key. If set, --certificate-ttl must be provided.
  - `gpg-alg` string — gpg alg: Relevant only if GPG key type selected; options: [RSA1024, RSA2048, RSA3072, RSA4096, Ed25519]
  - `hash-algorithm` string — Specifies the hash algorithm used for the encryption key's operations, available options: [SHA256, SHA384, SHA512]
  - `item-custom-fields` object — Additional custom fields to associate with the item
  - `json` boolean — Set output format to JSON
  - `key-data` string — Base64-encoded classic key value
  - `metadata` string — Deprecated - use description
  - `name` string, required — ClassicKey name
  - `protection-key-name` string — The name of a key that used to encrypt the secret value (if empty, the account default protectionKey key will be used)
  - `rotation-event-in` string[] — How many days before the rotation of the item would you like to be notified
  - `rotation-interval` string — The number of days to wait between every automatic rotation (1-365)
  - `tags` string[] — Add tags attached to this object
  - `token` string — Authentication token (see `/auth` and `/configure`)
  - `uid-token` string — The universal identity token, Required only for universal_identity authentication

## Response `201`

CreateClassicKeyResponse wraps response body.

- CreateClassicKeyOutput
  - `classic_key_id` string
  - `classic_key_name` string
  - `classic_key_type` string
  - `public_key` string

## Other responses

- `default` — errorResponse wraps any error to return it as a JSON object with one "error" field.

---

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