# Rotate the signing key

The signing key is used to digitally sign tokens and ensure their authenticity and integrity. Rotate the signing key to replace the current key with a new one that has updated security credentials.  This improves security and reduces the risk of compromised keys being used for malicious purposes: even if a previous key is exposed, future tokens remain secure. This enforces token expiration by making previously issued tokens invalid if they were signed with an old key. You cannot rotate the signing key if you already have one active key and two previous keys.

Endpoint: POST /api/token/v2/rotatekey
Version: v2.0
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer JWT

## Response 204:

  - `204` (unknown)
    The signing key was changed successfully

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `type` (string)

  - `title` (string)

  - `status` (integer)

  - `detail` (string)

  - `instance` (string)

  - `errors` (object)

## Response 401:

  - `401` (unknown)
    Invalid bearer token

## Response 401 fields (application/json):

  - `type` (string)

  - `title` (string)

  - `status` (integer)

  - `detail` (string)

  - `instance` (string)

## Response 403:

  - `403` (unknown)
    Request does not contain required scopes

## Response 403 fields (application/json):

  - `type` (string)

  - `title` (string)

  - `status` (integer)

  - `detail` (string)

  - `instance` (string)

## Response 404:

  - `404` (unknown)
    Tenant not found

## Response 404 fields (application/json):

  - `type` (string)

  - `title` (string)

  - `status` (integer)

  - `detail` (string)

  - `instance` (string)

