---
title: "Save only changed agent keys with revision compare and swap"
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

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

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` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.path.workspaceId`; string, required)
- `agentId` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.path.agentId`; string, required)
  - format `uuid`

## Request body

_Required._

- `revision` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.revision`; integer, required)
  - min 0
- `name` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.name`; string, optional)
  - maxLength 120
- `instructions` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.instructions`; string, optional)
- `voice` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.voice`; string, optional)
- `model` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.model`; string, optional)
- `outbound_voicemail_message` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.outbound_voicemail_message`; string, optional) — Fixed AI queue voicemail drop message; empty means hang up without leaving a message
- `agent_enabled` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.agent_enabled`; boolean, optional)
- `excluded_from_checklist` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.excluded_from_checklist`; boolean, optional)
- `lookup_http_auth_token` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.lookup_http_auth_token`; string, optional)
- `lookup_builtin_api_key` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.lookup_builtin_api_key`; string, optional)
- `call_steps` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.call_steps`; object, optional)
- `allowed_tools` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.allowed_tools`; array<string>, optional)
- `structured_output_fields` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.structured_output_fields`; array<object>, optional)

## Example request

```json
{
  "revision": 0,
  "name": "string",
  "instructions": "string",
  "voice": "string",
  "model": "string",
  "outbound_voicemail_message": "string",
  "agent_enabled": true,
  "excluded_from_checklist": true,
  "lookup_http_auth_token": "string",
  "lookup_builtin_api_key": "string",
  "call_steps": {},
  "allowed_tools": [
    "string"
  ],
  "structured_output_fields": [
    {}
  ]
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/agents/<agentId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "revision": 0,
  "name": "string",
  "instructions": "string",
  "voice": "string",
  "model": "string",
  "outbound_voicemail_message": "string",
  "agent_enabled": true,
  "excluded_from_checklist": true,
  "lookup_http_auth_token": "string",
  "lookup_builtin_api_key": "string",
  "call_steps": {},
  "allowed_tools": [
    "string"
  ],
  "structured_output_fields": [
    {}
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/workspaces/<workspaceId>/voice-ai/agents/<agentId>';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    revision: 0,
    name: 'string',
    instructions: 'string',
    voice: 'string',
    model: 'string',
    outbound_voicemail_message: 'string',
    agent_enabled: true,
    excluded_from_checklist: true,
    lookup_http_auth_token: 'string',
    lookup_builtin_api_key: 'string',
    call_steps: {},
    allowed_tools: ['string'],
    structured_output_fields: [{}]
  })
};

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>"

payload = {
    "revision": 0,
    "name": "string",
    "instructions": "string",
    "voice": "string",
    "model": "string",
    "outbound_voicemail_message": "string",
    "agent_enabled": True,
    "excluded_from_checklist": True,
    "lookup_http_auth_token": "string",
    "lookup_builtin_api_key": "string",
    "call_steps": {},
    "allowed_tools": ["string"],
    "structured_output_fields": [{}]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(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` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.response.200.success`; boolean, optional)
- `agent` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.response.200.agent`; object, optional) — Profile metadata and name without voice_config or credentials
- `legacy` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.response.200.legacy`; boolean, optional) — True until profiles have been explicitly created
- `uses_builtin` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.response.200.uses_builtin`; boolean, optional) — True when an OpenAI voice_ai block or profiles exist; controls the built-in fleet and tour
- `agents` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.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` (`put/api/workspaces/workspaceId/voice-ai/agents/agentId.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/put-api-workspaces-workspace-id-voice-ai-agents-agent-id/index.md
