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

# Regenerate an API key

> Admin only. Rotates one of the account's keys: cancels the old secret and issues a new one, carrying the key's reference, expiry, type, parallelism, fairness weight and allowed origins forward. The old key stops working immediately, so update integrations with the returned key.



## OpenAPI

````yaml /openapi.json post /admin/keys/{ApiKeyId}/regenerate
openapi: 3.0.0
info:
  title: NestAPI
  version: '1.0'
servers:
  - description: Staging
    url: https://dev.api.nestapi.com
security: []
tags:
  - name: account
    description: API key and account management
  - name: ApiAdmin
  - name: auth
  - name: fairness
    description: >-
      Per-customer nesting-minutes fairness config, weights and usage (requires
      an Admin API key)
  - name: importer
  - name: nesting
    description: Submit nesting jobs, retrieve results and exports
  - name: public
    description: Health check and public utility endpoints
paths:
  /admin/keys/{ApiKeyId}/regenerate:
    parameters:
      - $ref: '#/components/parameters/Accept'
    post:
      tags:
        - account
      summary: Regenerate an API key
      description: >-
        Admin only. Rotates one of the account's keys: cancels the old secret
        and issues a new one, carrying the key's reference, expiry, type,
        parallelism, fairness weight and allowed origins forward. The old key
        stops working immediately, so update integrations with the returned key.
      operationId: RegenerateApiKey
      parameters:
        - name: ApiKeyId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegenerateApiKey'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientKey'
      deprecated: false
      security:
        - Bearer: []
components:
  parameters:
    Accept:
      name: Accept
      in: header
      description: Accept Header
      required: true
      schema:
        type: string
        enum:
          - application/json
  schemas:
    RegenerateApiKey:
      title: RegenerateApiKey
      properties:
        ApiKeyId:
          type: string
      description: RegenerateApiKey
      type: object
    ClientKey:
      title: ClientKey
      properties:
        ApiKey:
          type: string
        ClientRef:
          type: string
        Expired:
          type: boolean
          nullable: false
        IsActive:
          type: boolean
          nullable: false
        Expires:
          type: string
          format: date-time
        CancelledDate:
          type: string
          format: date-time
        Parallelism:
          type: integer
          format: int32
          nullable: false
        IsTrial:
          type: boolean
          nullable: false
        KeyType:
          type: string
      description: ClientKey
      type: object
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````