---
title: "Update an API key"
description: "Requires a verified session and current workspace membership; metadata roles never authorize key access. Existing key ownership and operation checks remain in force. Refuses (400 USE_AI_CONNECTORS_SETTINGS) adding \"mcp\" to a key; an existing AI connector key may only be renamed or deactivated here (no permission, expiry or re-activation change)."
---

> 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

`PUT /api/api-keys/{id}`

Requires a verified session and current workspace membership; metadata roles never authorize key access. Existing key ownership and operation checks remain in force. Refuses (400 USE_AI_CONNECTORS_SETTINGS) adding "mcp" to a key; an existing AI connector key may only be renamed or deactivated here (no permission, expiry or re-activation change).

## Authentication

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

## Path parameters

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

## Header parameters

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

## Example request

```json
{}
```

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/api-keys/<id>';
const options = {
  method: 'PUT',
  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>"

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

response = requests.put(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/put-api-api-keys-id/index.md
