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

# Rotate an API key

> Replaces the secret of an API key while keeping its identity, name, budget and settings. The previous secret stops working immediately and the new one is returned exactly once in this response. A revoked key cannot be rotated and returns 404. Requires the `manage:write` scope.



## OpenAPI

````yaml https://api.edenai.run/v2/info/splitted-schema/management_api/openapi.json post /v3/manage/keys/{key_id}/rotate/
openapi: 3.0.3
info:
  title: Organization Management
  version: '2.0'
  description: Your project description
servers:
  - url: https://api.edenai.run
security: []
paths:
  /v3/manage/keys/{key_id}/rotate/:
    post:
      tags:
        - API Keys
      summary: Rotate an API key
      description: >-
        Replaces the secret of an API key while keeping its identity, name,
        budget and settings. The previous secret stops working immediately and
        the new one is returned exactly once in this response. A revoked key
        cannot be rotated and returns 404. Requires the `manage:write` scope.
      operationId: manage_keys_rotate_create
      parameters:
        - in: path
          name: key_id
          schema:
            type: string
            format: uuid
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RotatedApiKey'
          description: ''
      security:
        - ManagementKeyAuth: []
components:
  schemas:
    RotatedApiKey:
      type: object
      properties:
        secret:
          type: string
          description: The new key value. Shown only in this response; store it securely.
        masked:
          type: string
        name:
          type: string
      required:
        - masked
        - name
        - secret
  securitySchemes:
    ManagementKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        A management key (created from the organization dashboard or with `POST
        /v3/manage/auth-keys`), sent as `Authorization: Bearer
        <management_key>`. Inference API keys (`sk-eden...`) are not accepted on
        these endpoints.

````