> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revstack.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate an API key

> Generates a new key value and archives the old one.



## OpenAPI

````yaml post /v1/system/api-keys/{key}/rotate
openapi: 3.0.0
info:
  title: Revstack API
  version: 1.0.0
  description: >-
    Open Source Billing OS for Developers. The scalable, developer-first billing
    engine with subscriptions, invoicing, usage metering, and entitlements.
servers:
  - url: http://localhost:6900
    description: Revstack API (Local Development)
security: []
paths:
  /v1/system/api-keys/{key}/rotate:
    post:
      tags:
        - API Keys
      summary: Rotate an API key
      description: Generates a new key value and archives the old one.
      parameters:
        - schema:
            type: string
            example: sk_live_abc123
          required: true
          name: key
          in: path
      responses:
        '200':
          description: New key generated
          content:
            application/json:
              schema:
                nullable: true

````