---
title: "Duplicate an agent on the server while retaining lookup credentials"
description: "Requires workspace owner, admin or manager. No page-load initialization. Creation requires capability version 1 from voice_service, ingest_worker and trigger."
---

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

`POST /api/workspaces/{workspaceId}/voice-ai/agents/{agentId}/duplicate`

Requires workspace owner, admin or manager. No page-load initialization. Creation requires capability version 1 from voice_service, ingest_worker and trigger.

## Authentication

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

## Path parameters

- `workspaceId` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.path.workspaceId`; string, required)
- `agentId` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.path.agentId`; string, required)
  - format `uuid`

## Request body

_Required._

- `idempotency_key` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.idempotency_key`; string, required)
  - maxLength 200
- `name` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.name`; string, optional)
  - maxLength 120

## Example request

```json
{
  "name": "string",
  "idempotency_key": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/agents/<agentId>/duplicate' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "idempotency_key": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/agents/<agentId>/duplicate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({name: 'string', idempotency_key: 'string'})
};

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>/voice-ai/agents/<agentId>/duplicate"

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

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

print(response.text)
```

## Responses

### 200

Successful response with masked settings

#### Example

```json
{
  "success": true,
  "agent": {},
  "legacy": true,
  "uses_builtin": true,
  "agents": [
    {}
  ],
  "config": {}
}
```

- `success` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.response.200.success`; boolean, optional)
- `agent` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.response.200.agent`; object, optional) — Profile metadata and name without voice_config or credentials
- `legacy` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.response.200.legacy`; boolean, optional) — True until profiles have been explicitly created
- `uses_builtin` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.response.200.uses_builtin`; boolean, optional) — True when an OpenAI voice_ai block or profiles exist; controls the built-in fleet and tour
- `agents` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.response.200.agents`; array<object>, optional) — Without profiles the latest legacy voice row is returned. A built-in config without a pointer returns a legacy entry with null agent_id that opens workspace settings without initialization.
- `config` (`post/api/workspaces/workspaceId/voice-ai/agents/agentId/duplicate.response.200.config`; object, optional) — Normalized settings with credential configured booleans

### 400

Invalid request or unavailable agent

### 401

Authentication required

### 403

Workspace admin or manager required

### 404

Agent not found

### 409

Stale revision

### 500

Service error

### 503

Migration or consumer capabilities unavailable


Source: https://developer.channelautomations.com/api/post-api-workspaces-workspace-id-voice-ai-agents-agent-id-duplicate/index.md
