# KMS Key


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

Operations for KMS Key lifecycle management.

[Read more](https://community.exoscale.com/documentation/kms/kms-key)

## <span data-label="POST" class="pill-POST"></span>enable-kms-key

Enable KMS Key

```
POST /kms-key/{id}/enable
```

Enables a KMS Key by setting its stated to "enabled". It restores the ability to fully use the KMS key for cryptographic operations and key lifecycle operations.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `status` | string | Allowed values: `success`, `target-registered`, `already-applied`.<br/><br/>Default: `success`. |

<details>
<summary>Example output</summary>

```json
{
  "status": "success"
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `enable-kms-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.EnableKmsKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.enable_kms_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#enableKmsKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api enable-kms-key`

## <span data-label="POST" class="pill-POST"></span>disable-kms-key

Disable KMS Key

```
POST /kms-key/{id}/disable
```

Disables a KMS Key by setting its state to "disabled". This prevents the use of the KMS key for cryptographic and key lifecycle operations.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `status` | string | Allowed values: `success`, `target-registered`, `already-applied`.<br/><br/>Default: `success`. |

<details>
<summary>Example output</summary>

```json
{
  "status": "success"
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `disable-kms-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DisableKmsKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.disable_kms_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#disableKmsKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api disable-kms-key`

## <span data-label="POST" class="pill-POST"></span>create-kms-key

Create KMS Key

```
POST /kms-key
```

Create a customer-managed unique KMS Key in your organization. A KMS Key is a logical represention of a cryptographic key material. It also includes metadata such as a UUID, a name and its state.

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | **yes** | A human-readable display name uniquely identifying the KMS key within the tenant space. |
| `description` | string | no | An optional detailed description providing additional context about the key's intended use case. |
| `multi-zone` | boolean | no | True if this is a multi-zone key.<br/><br/>Default: `false`. |
| `usage` | string | no | Allowed values: `encrypt-decrypt`.<br/><br/>Default: `encrypt-decrypt`. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "multi-zone": true,
  "name": "string",
  "usage": "encrypt-decrypt"
}
```
</details>


### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | The UTC timestamp showing when the KMS key was originally provisioned.<br/><br/>ISO 8601 date-time. |
| `description` | string | An optional detailed description providing additional context about the key's intended use case. |
| `id` | string | The globally unique identifier (UUID) assigned to the newly created KMS key.<br/><br/>Must be a valid UUID. |
| `multi-zone` | boolean | True if this is a multi-zone key. |
| `name` | string | The display name assigned to the KMS key. |
| `origin-zone` | string | The creation zone of the KMS key. |
| `revision` | [Revision Stamp](/reference/api/_schemas/revision-stamp/) |  |
| `source` | string | Allowed values: `exoscale-kms`. |
| `status` | string | Allowed values: `enabled`, `disabled`, `pending-deletion`. |
| `status-since` | string | The timestamp indicating exactly when the current key status was last transitioned.<br/><br/>ISO 8601 date-time. |
| `usage` | string | The cryptographic operation constraints allowed on this key. |

<details>
<summary>Example output</summary>

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "string",
  "multi-zone": true,
  "name": "string",
  "origin-zone": "string",
  "revision": {
    "at": "2024-01-01T12:00:00Z",
    "seq": 0
  },
  "source": "exoscale-kms",
  "status": "enabled",
  "status-since": "2024-01-01T12:00:00Z",
  "usage": "string"
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `create-kms-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateKmsKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_kms_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createKmsKey(com.exoscale.sdk.model.CreateKmsKeyRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-kms-key`

## <span data-label="GET" class="pill-GET"></span>get-kms-key

Get KMS Key

```
GET /kms-key/{id}
```

Retrieve KMS Key details.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | The UTC timestamp showing when the KMS key was originally provisioned.<br/><br/>ISO 8601 date-time. |
| `delete-at` | string | ISO 8601 date-time. |
| `description` | string | An optional detailed description providing additional context about the key's intended use case. |
| `id` | string | The globally unique identifier (UUID) of the retrieved KMS key.<br/><br/>Must be a valid UUID. |
| `material` | [Key Material](/reference/api/_schemas/key-material/) |  |
| `multi-zone` | boolean | True if this is a multi-zone key. |
| `name` | string | The display name of the KMS key. |
| `origin-zone` | string | The creation zone of the KMS key. |
| `replicas` | array[string] | A list of availability zones where this specific key has active replica mirrors. |
| `replicas-status` | array of [Replica State](/reference/api/_schemas/replica-state/) | Detailed synchronization metrics for each regional replica mirror. |
| `revision` | [Revision Stamp](/reference/api/_schemas/revision-stamp/) |  |
| `rotation` | [Key Rotation Config](/reference/api/_schemas/key-rotation-config/) |  |
| `source` | string | Allowed values: `exoscale-kms`. |
| `status` | string | Allowed values: `enabled`, `disabled`, `pending-deletion`. |
| `status-since` | string | The timestamp indicating exactly when the current key status was last transitioned.<br/><br/>ISO 8601 date-time. |
| `usage` | string | The cryptographic operation constraints allowed on this key. |

<details>
<summary>Example output</summary>

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "delete-at": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "string",
  "material": {
    "automatic": true,
    "created-at": "2024-01-01T12:00:00Z",
    "version": 0
  },
  "multi-zone": true,
  "name": "string",
  "origin-zone": "string",
  "replicas": [
    "string"
  ],
  "replicas-status": [
    {
      "last-applied-watermark": 0,
      "last-failure": {
        "attempted-watermark": 0,
        "error": "string",
        "failed-at": "2024-01-01T12:00:00Z"
      },
      "zone": "string"
    }
  ],
  "revision": {
    "at": "2024-01-01T12:00:00Z",
    "seq": 0
  },
  "rotation": {
    "automatic": true,
    "manual-count": 0,
    "next-at": "2024-01-01T12:00:00Z",
    "rotation-period": 0
  },
  "source": "exoscale-kms",
  "status": "enabled",
  "status-since": "2024-01-01T12:00:00Z",
  "usage": "string"
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `get-kms-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetKmsKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_kms_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getKmsKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-kms-key`

## <span data-label="POST" class="pill-POST"></span>disable-kms-key-rotation

Disable Key Rotation

```
POST /kms-key/{id}/disable-key-rotation
```

Disable the periodic rotation of a KMS Key.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `rotation` | [Key Rotation Config](/reference/api/_schemas/key-rotation-config/) |  |

<details>
<summary>Example output</summary>

```json
{
  "rotation": {
    "automatic": true,
    "manual-count": 0,
    "next-at": "2024-01-01T12:00:00Z",
    "rotation-period": 0
  }
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `disable-kms-key-rotation`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DisableKmsKeyRotation) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.disable_kms_key_rotation) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#disableKmsKeyRotation(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api disable-kms-key-rotation`

## <span data-label="POST" class="pill-POST"></span>enable-kms-key-rotation

Enable Key Rotation

```
POST /kms-key/{id}/enable-key-rotation
```

Enable the periodic rotation of a KMS Key.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `rotation-period` | integer | no | The number of days between each automatic key rotation.<br/><br/>Min: `90`. Max: `2560`. Default: `365`. |

<details>
<summary>Example</summary>

```json
{
  "rotation-period": 0
}
```
</details>


### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `rotation` | [Key Rotation Config](/reference/api/_schemas/key-rotation-config/) |  |

<details>
<summary>Example output</summary>

```json
{
  "rotation": {
    "automatic": true,
    "manual-count": 0,
    "next-at": "2024-01-01T12:00:00Z",
    "rotation-period": 0
  }
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `enable-kms-key-rotation`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.EnableKmsKeyRotation) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.enable_kms_key_rotation) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#enableKmsKeyRotation(java.util.UUID,com.exoscale.sdk.model.EnableKmsKeyRotationRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api enable-kms-key-rotation`


---

## Other Operations

## <span data-label="POST" class="pill-POST"></span>cancel-kms-key-deletion

Cancel KMS Key Deletion

```
POST /kms-key/{id}/cancel-deletion
```

Cancels the scheduled deletion of a KMS Key.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `status` | string | Allowed values: `success`, `target-registered`, `already-applied`.<br/><br/>Default: `success`. |

<details>
<summary>Example output</summary>

```json
{
  "status": "success"
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `cancel-kms-key-deletion`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CancelKmsKeyDeletion) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.cancel_kms_key_deletion) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#cancelKmsKeyDeletion(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api cancel-kms-key-deletion`

## <span data-label="GET" class="pill-GET"></span>list-kms-key-rotations

List KMS Key Rotations

```
GET /kms-key/{id}/list-key-rotations
```

List all the key material versions of a KMS Key.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `rotations` | array of [List Kms Key Rotations Response Entry](/reference/api/_schemas/list-kms-key-rotations-response-entry/) | A chronologically ordered collection tracking historical rotation lifecycle occurrences for this resource. |

<details>
<summary>Example output</summary>

```json
{
  "rotations": [
    {
      "automatic": true,
      "rotated-at": "2024-01-01T12:00:00Z",
      "version": 0
    }
  ]
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `list-kms-key-rotations`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListKmsKeyRotations) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_kms_key_rotations) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listKmsKeyRotations(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-kms-key-rotations`

## <span data-label="GET" class="pill-GET"></span>list-kms-keys

List KMS Keys

```
GET /kms-key
```

Lists all KMS Keys in your organization in a given zone.

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `kms-keys` | array of [List Kms Keys Response Entry](/reference/api/_schemas/list-kms-keys-response-entry/) | An array containing metadata entries for all available keys for your organization in the requested zone. |

<details>
<summary>Example output</summary>

```json
{
  "kms-keys": [
    {
      "created-at": "2024-01-01T12:00:00Z",
      "delete-at": "2024-01-01T12:00:00Z",
      "description": "string",
      "id": "string",
      "material": {
        "automatic": true,
        "created-at": "2024-01-01T12:00:00Z",
        "version": 0
      },
      "multi-zone": true,
      "name": "string",
      "origin-zone": "string",
      "replicas": [
        "string"
      ],
      "revision": {
        "at": "2024-01-01T12:00:00Z",
        "seq": 0
      },
      "rotation": {
        "automatic": true,
        "manual-count": 0,
        "next-at": "2024-01-01T12:00:00Z",
        "rotation-period": 0
      },
      "source": "exoscale-kms",
      "status": "enabled",
      "status-since": "2024-01-01T12:00:00Z",
      "usage": "string"
    }
  ]
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `list-kms-keys`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListKmsKeys) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_kms_keys) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listKmsKeys())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-kms-keys`

## <span data-label="POST" class="pill-POST"></span>replicate-kms-key

Replicate KMS Key

```
POST /kms-key/{id}/replicate
```

Replicate a KMS key to a target zone.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `zone` | string | **yes** | The targeted cloud zone where the KMS key should be replicated. |

<details>
<summary>Example</summary>

```json
{
  "zone": "string"
}
```
</details>


### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `status` | string | Allowed values: `success`, `target-registered`, `already-applied`.<br/><br/>Default: `success`. |

<details>
<summary>Example output</summary>

```json
{
  "status": "success"
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `replicate-kms-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ReplicateKmsKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.replicate_kms_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#replicateKmsKey(java.util.UUID,com.exoscale.sdk.model.ReplicateKmsKeyRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api replicate-kms-key`

## <span data-label="POST" class="pill-POST"></span>rotate-kms-key

Rotate Key

```
POST /kms-key/{id}/rotate
```

Performs an immediate rotation of the key material for a symmetric key.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `rotation` | [Key Rotation Config](/reference/api/_schemas/key-rotation-config/) |  |

<details>
<summary>Example output</summary>

```json
{
  "rotation": {
    "automatic": true,
    "manual-count": 0,
    "next-at": "2024-01-01T12:00:00Z",
    "rotation-period": 0
  }
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `rotate-kms-key`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.RotateKmsKey) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.rotate_kms_key) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#rotateKmsKey(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api rotate-kms-key`

## <span data-label="POST" class="pill-POST"></span>schedule-kms-key-deletion

Schedule KMS Key Deletion

```
POST /kms-key/{id}/schedule-deletion
```

Schedules a KMS key for deletion after a delay. You can specify a delay of 7-30 days.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `delay-days` | integer | no | Number of days to wait until deletion is final.<br/><br/>Min: `7`. Max: `30`. Default: `30`. |

<details>
<summary>Example</summary>

```json
{
  "delay-days": 0
}
```
</details>


### Responses

**`200`**: 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `delete-at` | string | Timestamp of the key deletion<br/><br/>ISO 8601 date-time. |

<details>
<summary>Example output</summary>

```json
{
  "delete-at": "2024-01-01T12:00:00Z"
}
```
</details>

**`400`**: 400

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `detail` | string | A highly contextual, readable explanation breaking down explicitly what triggered this error scenario. |
| `status` | integer | Min: `100`. Max: `599`. |
| `title` | string | A brief summary defining the class of failure, optimal for quick user interface groupings. |
| `type` | string | An absolute or relative URI reference pointing to human-readable documentation concerning the specific problem type encountered.<br/><br/>Must be a valid URI reference. |

<details>
<summary>Example output</summary>

```json
{
  "detail": "string",
  "status": 0,
  "title": "string",
  "type": "string"
}
```
</details>


SDK reference for `schedule-kms-key-deletion`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ScheduleKmsKeyDeletion) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.schedule_kms_key_deletion) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#scheduleKmsKeyDeletion(java.util.UUID,com.exoscale.sdk.model.ScheduleKmsKeyDeletionRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api schedule-kms-key-deletion`


