- [HTTP request](https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/create#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/create#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/create#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/create#body.request_body)
- [Response body](https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/create#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/create#body.aspect)
- [Try it!](https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys/create#try-it)

**Full name**: projects.locations.keyRings.cryptoKeys.create

Create a new `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey` within a `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings#KeyRing`.

`https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey.FIELDS.purpose` and `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKeyVersionTemplate.FIELDS.algorithm` are required.

### HTTP request

Choose an endpoint:
global europe-west6 us-east7 europe-west3 us-west8 europe-west9 me-central2 us-east1 us-west1 us-west3 us-central2 us-east4 us-west2 europe-west8 us-central1 us-west4 us-east5 us-south1 northamerica-northeast1 northamerica-northeast2 us in ca   
`POST https://cloudkms.googleapis.com/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings#KeyRing.FIELDS.name` of the KeyRing associated with the `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `cloudkms.cryptoKeys.create` |

### Query parameters

| Parameters ||
|---|---|
| `cryptoKeyId` | `string` Required. It must be unique within a KeyRing and match the regular expression `[a-zA-Z0-9_-]{1,63}` |
| `skipInitialVersionCreation` | `boolean` If set to true, the request will create a `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey` without any `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions#CryptoKeyVersion`. You must manually call `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions/create#google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion` or `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions/import#google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion` before you can use this `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey`. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey`.

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloudkms`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).