# 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. {% admonition type="info" name="Note" %}You cannot rotate the signing key if you already have one active key and two previous keys.{% /admonition %}

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

## Response 400 fields (application/json):

  - `type` (string,null)

  - `title` (string,null)

  - `status` (integer,null)

  - `detail` (string,null)

  - `instance` (string,null)

  - `errors` (object)

## Response 401 fields (application/json):

  - `type` (string,null)

  - `title` (string,null)

  - `status` (integer,null)

  - `detail` (string,null)

  - `instance` (string,null)


## Response 204 fields
