POST
/
api
/
v2
/
keys
/
{key_id}
/
regenerate
curl -X POST \
  https://api.buena.ai/api/v2/keys/key_123/regenerate \
  -H "x-api-key: YOUR_API_KEY"
{
  "id": "key_123",
  "key": "bai_new_generated_key_here",
  "name": "Production API Key",
  "created_at": "2024-01-01T00:00:00Z",
  "last_used_at": null
}

Regenerates an existing API key, invalidating the old key and creating a new one.

This action will immediately invalidate the old API key. Make sure to update your applications with the new key.

Path Parameters

key_id
string
required

The unique identifier of the API key to regenerate

Response

id
string

The unique identifier of the API key

key
string

The new API key value

name
string

The name of the API key

created_at
string

The timestamp when the key was regenerated

last_used_at
string

The timestamp when the key was last used (will be null for new keys)

curl -X POST \
  https://api.buena.ai/api/v2/keys/key_123/regenerate \
  -H "x-api-key: YOUR_API_KEY"
{
  "id": "key_123",
  "key": "bai_new_generated_key_here",
  "name": "Production API Key",
  "created_at": "2024-01-01T00:00:00Z",
  "last_used_at": null
}