---
title: "Create an AI connector integration key (value shown once)"
description: "Owners and admins. The key acts as the caller: it stops working if the caller leaves the\nworkspace, loses an allowed role, or becomes folder-restricted. It holds exactly\n{\"mcp\":[\"read\"]}, works only with the AI connector (MCP) server and is refused by every REST\nroute. Only its SHA-256 hash is stored (key_full is NULL). Expiry defaults to, and may not\nexceed, 90 days. The caller must be eligible (current role allowed,\nnot folder-restricted, workspace not cancelled/suspended).\n"
---

> 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 › AI Connectors

`POST /api/workspaces/{workspaceId}/ai-connectors/integration-keys`

Owners and admins. The key acts as the caller: it stops working if the caller leaves the
workspace, loses an allowed role, or becomes folder-restricted. It holds exactly
{"mcp":["read"]}, works only with the AI connector (MCP) server and is refused by every REST
route. Only its SHA-256 hash is stored (key_full is NULL). Expiry defaults to, and may not
exceed, 90 days. The caller must be eligible (current role allowed,
not folder-restricted, workspace not cancelled/suspended).

## Authentication

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

## Path parameters

- `workspaceId` (`post/api/workspaces/workspaceId/ai-connectors/integration-keys.path.workspaceId`; string, required)

## Request body

_Required._

- `name` (`post/api/workspaces/workspaceId/ai-connectors/integration-keys.name`; string, required)
  - minLength 3; maxLength 100
- `expires_at` (`post/api/workspaces/workspaceId/ai-connectors/integration-keys.expires_at`; string, optional) — Default and maximum now + 90 days
  - format `date-time`

## Example request

```json
{
  "name": "string",
  "expires_at": "2019-08-24T14:15:22Z"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/workspaces/<workspaceId>/ai-connectors/integration-keys' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "expires_at": "2019-08-24T14:15:22Z"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/workspaces/<workspaceId>/ai-connectors/integration-keys';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({name: 'string', expires_at: '2019-08-24T14:15:22Z'})
};

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/workspaces/<workspaceId>/ai-connectors/integration-keys"

payload = {
    "name": "string",
    "expires_at": "2019-08-24T14:15:22Z"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

{ success, data: { id, name, expires_at, created_at, api_key (crm_live_…, shown once), warning } }

### 400

Invalid name or expiry, or the active-key limit is reached

### 403

Not an owner or admin

### 409

Caller not eligible: code NOT_IN_PILOT, WORKSPACE_INACTIVE, TURNED_OFF, ROLE_NOT_ALLOWED or RESTRICTED

### 503

AI_CONNECTORS_NOT_SET_UP, or unavailable


Source: https://developer.channelautomations.com/api/post-api-workspaces-workspace-id-ai-connectors-integration-keys/index.md
