---
title: "Rotate/Regenerate an API Key"
method: POST
path: "/v1/api-keys/{id}/regenerate"
tags: ["API Keys"]
---

# Rotate/Regenerate an API Key

`POST /v1/api-keys/{id}/regenerate`

Generates and returns a new secure raw key string for an existing API Key while keeping metadata, scopes, and association unchanged.

## Path parameters

- `id` string, uuid, required

## Response `200`

API key regenerated successfully

- APIKeyCreatedResponse
  - `id` string, uuid, required — Unique API Key identifier.
  - `name` string, required — Human-readable name of the key.
  - `key` string, required — The fully generated secure raw API Key string. This is returned ONLY ONCE.
  - `operation` string, required
  - `created_at` string, date-time, required — Timestamp of creation.

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — API key not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/px0-ai/apis/px0-api.md) · [All operations](https://skmtc.net/px0-ai/apis/px0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/px0-ai/px0-api/revisions/3ed72443989d/schema)
