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

# Regenerate API key

> Regenerates an API key by revoking the old key and creating a new one with the same settings. **The old key is permanently deleted** — its `id` is no longer valid. The response contains a new `id` (UUID) which must be used for all future operations on this key. The new full token is returned **only in this response** — store it securely. You cannot regenerate the key you are currently using. Permission: `account:apikeys:regenerate`.



## OpenAPI

````yaml /openapi-account.json post /v4/account/api-keys/{id}/regenerate
openapi: 3.0.3
info:
  title: ProxyScrape Account API
  description: Account API — authenticate with the api-token header.
  version: 1.0.0
servers:
  - url: https://api.proxyscrape.com
    description: ProxyScrape API
security:
  - apiToken: []
tags:
  - name: API key management
    description: Create, list, update, regenerate, and revoke API keys
  - name: Subaccounts
    description: List subaccounts and manage preferences
  - name: Datacenter
    description: 'Datacenter shared and dedicated: overview, proxy list, usage, whitelist'
  - name: Residential
    description: 'Residential (bandwidth): overview, subusers, usage'
  - name: Residential unlimited
    description: 'Residential unlimited: overview, statistics, password'
  - name: SERP API
    description: 'SERP API: overview, subusers, search'
  - name: API ordering
    description: >-
      Place wallet-paid orders and read the wallet balance via the headless API
      ordering surface.
paths:
  /v4/account/api-keys/{id}/regenerate:
    post:
      tags: []
      summary: Regenerate API key
      description: >-
        Regenerates an API key by revoking the old key and creating a new one
        with the same settings. **The old key is permanently deleted** — its
        `id` is no longer valid. The response contains a new `id` (UUID) which
        must be used for all future operations on this key. The new full token
        is returned **only in this response** — store it securely. You cannot
        regenerate the key you are currently using. Permission:
        `account:apikeys:regenerate`.
      operationId: regenerateApiKey
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: New key created. Token returned only once — store immediately.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: >-
                          New UUID for the regenerated key. The old `id` is no
                          longer valid — update any stored references.
                      old_id:
                        type: string
                        format: uuid
                        description: The UUID of the revoked key, for reference.
                      token:
                        type: string
                        description: >-
                          Full token secret. Only returned once — copy and store
                          securely.
                      name:
                        type: string
                      permissions:
                        type: array
                        items:
                          type: string
                      allowed_subaccounts:
                        type: array
                        items:
                          type: string
                      allowed_ips:
                        type: array
                        items:
                          type: string
                      expires_at:
                        type: integer
                        nullable: true
                      created_at:
                        type: integer
                        description: Unix timestamp of when the new key was created.
                  warning:
                    type: string
                    description: Reminder that the token is shown only once.
                  note:
                    type: string
                    description: Confirmation that the old token has been revoked.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Unauthorized
        '404':
          description: API key not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: API key not found
        '409':
          description: Cannot regenerate the API key currently in use
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Cannot regenerate the API key currently in use
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Failed to regenerate API key
      security:
        - apiToken: []
components:
  securitySchemes:
    apiToken:
      type: apiKey
      in: header
      name: api-token
      description: >-
        API key. Create and manage keys at /v4/account/api-keys or in the
        dashboard.

````