> ## 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.

# Regenerate a legacy primary/sandbox key

> Regenerate a legacy primary/sandbox key — a JWT stored in a ``User`` column,
not a ``Token`` row — as a real hashed ``sk-eden`` custom key.

Nulls the ``User`` column, which revokes the old JWT immediately in BOTH
services (edenai-back matches the column in ``auth.py``; aifeatures re-checks
it against the column on every request), and mints a new key returned exactly
once. The new key's name defaults to "Production"/"Sandbox" (auto-suffixed to
"Production 2" etc. if that name is already taken) and may be overridden in the
body. Session-only and NOT quota-gated — migrating an existing key is never
blocked, even at the custom-key cap. The old key can't authorize its own
replacement.



## OpenAPI

````yaml https://api.edenai.run/v2/info/splitted-schema/user/openapi.json post /user/custom_token/legacy/{legacy_type}/regenerate/
openapi: 3.0.3
info:
  title: User Management
  version: '2.0'
  description: Your project description
servers:
  - url: https://api.edenai.run/v2
security: []
paths:
  /user/custom_token/legacy/{legacy_type}/regenerate/:
    post:
      tags:
        - User Management
      summary: Regenerate a legacy primary/sandbox key
      description: >-
        Regenerate a legacy primary/sandbox key — a JWT stored in a ``User``
        column,

        not a ``Token`` row — as a real hashed ``sk-eden`` custom key.


        Nulls the ``User`` column, which revokes the old JWT immediately in BOTH

        services (edenai-back matches the column in ``auth.py``; aifeatures
        re-checks

        it against the column on every request), and mints a new key returned
        exactly

        once. The new key's name defaults to "Production"/"Sandbox"
        (auto-suffixed to

        "Production 2" etc. if that name is already taken) and may be overridden
        in the

        body. Session-only and NOT quota-gated — migrating an existing key is
        never

        blocked, even at the custom-key cap. The old key can't authorize its own

        replacement.
      operationId: user_legacy_regenerate_create
      parameters:
        - in: path
          name: legacy_type
          schema:
            type: string
          required: true
      responses:
        '200':
          description: No response body

````