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

# Regenerate API key

> Issue a new secret for an existing key, keeping its name. The plaintext is returned once.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/external/orgs/{slug}/api-keys/{key_id}/regenerate
openapi: 3.1.0
info:
  title: Lyceum Cloud Execution API
  version: 0.1.0
servers: []
security: []
paths:
  /api/v2/external/orgs/{slug}/api-keys/{key_id}/regenerate:
    post:
      tags:
        - API Keys
      summary: Regenerate API key
      description: >-
        Issue a new secret for an existing key, keeping its name. The plaintext
        is returned once.
      operationId: >-
        regenerate_org_api_key_api_v2_external_orgs__slug__api_keys__key_id__regenerate_post
      parameters:
        - name: key_id
          in: path
          required: true
          schema:
            type: string
            title: Key Id
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgApiKeyCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OrgApiKeyCreateResponse:
      properties:
        id:
          type: string
          title: Id
        org_id:
          type: string
          title: Org Id
        name:
          type: string
          title: Name
        prefix:
          type: string
          title: Prefix
        plaintext_key:
          type: string
          title: Plaintext Key
          description: The API key. Store it now — it will never be shown again.
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - id
        - org_id
        - name
        - prefix
        - plaintext_key
        - created_at
      title: OrgApiKeyCreateResponse
      description: Response for POST create — contains the plaintext key, shown once.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````