---
title: "Regenerate an API key"
description: "Requires a verified session and current workspace membership; metadata roles never authorize key access. An owner or admin may regenerate a teammate's key, but only the key's owner receives the new full value; for anyone else `data.api_key` is null. Refuses (400 USE_AI_CONNECTORS_SETTINGS) to regenerate an AI connector key; create a new one in Settings → AI Connectors instead."
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Workspaces

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

Requires a verified session and current workspace membership; metadata roles never authorize key access. An owner or admin may regenerate a teammate's key, but only the key's owner receives the new full value; for anyone else `data.api_key` is null. Refuses (400 USE_AI_CONNECTORS_SETTINGS) to regenerate an AI connector key; create a new one in Settings → AI Connectors instead.

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Path parameters

- `id` (`post/api/api-keys/id/regenerate.path.id`; string, required)

## Header parameters

- `X-Workspace-Id` (`post/api/api-keys/id/regenerate.header.X-Workspace-Id`; string, optional)

## Example request

```json
{}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/api-keys/<id>/regenerate' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/api-keys/<id>/regenerate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/api-keys/<id>/regenerate"

payload = {}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Operation completed

### 201

Key created

### 400

Invalid input or workspace missing

### 401

Verified session required

### 403

Membership or key authority denied

### 404

Key not found

### 503

Authority verification unavailable


Source: https://developer.channelautomations.com/api/post-api-api-keys-id-regenerate/index.md
