---
title: "Regenerate API key"
method: POST
path: "/v1/communities/{communityId}/api-keys/{keyId}/regenerate"
tags: ["API Keys"]
---

# Regenerate API key

`POST /v1/communities/{communityId}/api-keys/{keyId}/regenerate`

## Request

- Base URL: `https://api.subo.ai`
- URL: `https://api.subo.ai/v1/communities/{communityId}/api-keys/{keyId}/regenerate`
- Auth: API key in header `X-API-Key`

Issue a new key value for an existing API key. The old value is immediately invalidated — all in-flight requests using it will be rejected. The key's ID, name, community binding, and access level are preserved.

Returns the new full key value once — store it immediately. Admin role required.

## Path parameters

- `communityId` string, required
- `keyId` string, required

## Response `200`

New key value (shown once — store immediately)

- object
  - `data` object
    - `key_id` string
    - `key_prefix` string
    - `api_key` string: Full new API key value — store immediately, not recoverable

## Other responses

- `401`: Invalid or missing API key
- `403`: Forbidden — the key or user lacks permission for this resource or operation
- `404`: Key not found or not active
- `429`: Rate limit exceeded — wait `retry_after` seconds before retrying. The same value appears in the `Retry-After` header.

---

[API](https://skmtc.dev/subo/apis/subo-api.md) · [All operations](https://skmtc.dev/subo/apis/subo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/subo/apis/subo-api/revisions/12eab2ae4505?raw)
