# Rotate Signing Keys

> Rotate your signing keys

`POST /v2/keys/rotate`

Rotating signing keys lets you switch the keys used to sign messages without causing downtime.
This ensures that signatures remain valid and that the application can continue verifying new messages seamlessly.

During a rotation, the next key becomes the new current key, and a fresh next key is generated.

Make sure to update your application to use the new current and next keys after rotation.

## OpenAPI

````yaml workflow/openapi.yaml post /v2/keys/rotate
openapi: 3.1.0
info:
  title: Upstash Workflow REST API
  description: >
    Upstash Workflow is a serverless workflow orchestration service built on top
    of Upstash QStash and Upstash Redis.
  version: 2.0.0
  contact:
    name: Upstash
    url: https://upstash.com
servers:
  - url: https://qstash-{region}.upstash.io
    description: Regional
    variables:
      region:
        default: eu-central-1
        enum:
          - us-east-1
          - eu-central-1
security:
  - bearerAuth: []
  - bearerAuthQuery: []
paths:
  /v2/keys/rotate:
    post:
      summary: Rotate Signing Keys
      description: Rotate your signing keys
      x-mint:
        content: >
          Rotating signing keys lets you switch the keys used to sign messages
          without causing downtime.

          This ensures that signatures remain valid and that the application can
          continue verifying new messages seamlessly.


          During a rotation, the next key becomes the new current key, and a
          fresh next key is generated.


          Make sure to update your application to use the new current and next
          keys after rotation.
      tags:
        - Signing Keys
      responses:
        "200":
          description: Keys rotated successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SigningKeys"
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: QStash authentication token
    bearerAuthQuery:
      type: apiKey
      in: query
      name: qstash_token
      description: QStash authentication token passed as a query parameter
  schemas:
    SigningKeys:
      type: object
      properties:
        current:
          type: string
          description: The current signing key.
        next:
          type: string
          description: The next signing key.
````
