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

# Rotate your API key

> Generates a new API key and immediately invalidates the previous one. Update all integrations with the new key before making further requests.



## OpenAPI

````yaml https://api.revenuebase.ai/v2/openapi.json post /v2/account/api-keys/rotate
openapi: 3.1.0
info:
  title: Revenuebase API v2
  version: 0.1.0
servers:
  - url: https://api.revenuebase.ai
security: []
paths:
  /v2/account/api-keys/rotate:
    post:
      tags:
        - Account
      summary: Rotate your API key
      description: >-
        Generates a new API key and immediately invalidates the previous one.
        Update all integrations with the new key before making further requests.
      operationId: rotate_api_key_v2_account_api_keys_rotate_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewKeyResponse'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python SDK
          source: |-
            from revenuebase_sdk import RevenuebaseClient

            client = RevenuebaseClient()

            response = client.account.rotate_api_key()
            print(response.api_key)
components:
  schemas:
    NewKeyResponse:
      properties:
        api_key:
          type: string
          title: Api Key
      type: object
      required:
        - api_key
      title: NewKeyResponse
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-key

````