---
title: "Rotate Key"
method: POST
path: "/kms-key/{id}/rotate"
tags: ["kms-key"]
---

# Rotate Key

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

## Request

- Base URL: `https://api-ch-gva-2.exoscale.com/v2`
- URL: `https://api-ch-gva-2.exoscale.com/v2/kms-key/{id}/rotate`
- Auth: none declared
- TypeScript: <https://skmtc.dev/exoscale/apis/exoscale-api/docs/kms-key/:id/rotate/post.ts> (a function with typed inputs; its response is checked against the schema)

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

## Path parameters

- `id` string, uuid, required

## Response `200`

Key rotated

- RotateKmsKeyResponse
  - `rotation` KeyRotationConfig, required
    - `manual-count` integer, required: Total running tally of manual key rotation tasks executed by users over this key resource's lifecycle.
    - `automatic` boolean, required: When set to true, dictates that the system automatically rotates material periodically.
    - `rotation-period` integer, required: The set frequency period (measured in days) for triggers monitoring auto-rotation loops.
    - `next-at` string, date-time, required: Scheduled deadline calculation pinpointing the next automated rotational iteration target date.

## Other responses

- `400`: ### Errors Key Not Found: The request was rejected because the specified KMS Key could not be found. Key is Pending Deletion: The request was rejected because it was performed on a key that is pending deletion. Not on a Replica: The request was rejected because the operation is not allowed on a replica. Invalid Usage: The request was rejected because the operation is only allowed on symmetric keys with usage "encrypt-decrypt". Key is Disabled: The request was rejected because the specified KMS key is disabled. Manual Rotation Limit: The request was rejected because you reached your limit of 10 manual rotations per key for this KMS key.

## Changes

- **2026-11-06** `63da6f74c845`: 2 warning
  - removed the optional property `errors` from the response with the `400` status
  - removed the optional property `instance` from the response with the `400` status
- **2026-03-16** `e05707a7b346`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/exoscale/apis/exoscale-api/changes/kms-key/:id/rotate/post.md)

---

[API](https://skmtc.dev/exoscale/apis/exoscale-api.md) - [All operations](https://skmtc.dev/exoscale/apis/exoscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/exoscale/apis/exoscale-api/revisions/63da6f74c845?raw)
