---
title: "Regenerate API key"
method: POST
path: "/v4/account/api-keys/{id}/regenerate"
---

# Regenerate API key

`POST /v4/account/api-keys/{id}/regenerate`

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

## Path parameters

- `id` string, uuid, required

## Response `200`

New key created. Token returned only once — store immediately.

- object
  - `success` boolean
  - `message` string
  - `data` object
    - `id` string, uuid — New UUID for the regenerated key. The old `id` is no longer valid — update any stored references.
    - `old_id` string, uuid — The UUID of the revoked key, for reference.
    - `token` string — Full token secret. Only returned once — copy and store securely.
    - `name` string
    - `permissions` string[]
    - `allowed_subaccounts` string[]
    - `allowed_ips` string[]
    - `expires_at` integer, nullable
    - `created_at` integer — Unix timestamp of when the new key was created.
  - `warning` string — Reminder that the token is shown only once.
  - `note` string — Confirmation that the old token has been revoked.

## Other responses

- `401` — Unauthorized
- `404` — API key not found
- `409` — Cannot regenerate the API key currently in use
- `500` — Internal server error

---

[API](https://skmtc.net/proxyscrape/apis/proxyscrape-account-api.md) · [All operations](https://skmtc.net/proxyscrape/apis/proxyscrape-account-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/proxyscrape/proxyscrape-account-api/versions/4e10267785e1/schema)
