> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.claw-ops.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.claw-ops.com/_mcp/server.

# 에이전트 수정

PATCH https://api.claw-ops.com/v1/accounts/{accountId}/agents/{agentId}
Content-Type: application/json

에이전트 이름과 주요 실시간 음성 설정을 수정합니다. model은 OpenAI Realtime 에이전트, voice는 Cartesia 외부 TTS 에이전트에서 변경할 수 있습니다. 그 외 구성은 대시보드에서 변경합니다.

Reference: https://docs.claw-ops.com/api-레퍼런스/claw-ops-api/agents/update-agent

## Authentication

- `Authorization` header (bearer token, required) — API Key를 Bearer 토큰으로 전달

## Request

### Path parameters

- `accountId` (string, required) — 계정 ID
- `agentId` (string, required) — 에이전트 ID

### Body (application/json)

- `name` (string, optional)
- `instructions` (string, optional)
- `greeting` (boolean, optional)
- `model` (enum, optional)
  - Allowed values: `gpt-realtime-2.1`, `gpt-realtime-2.1-mini`
- `voice` (string, optional) — Cartesia voice ID
- `configuration` (object or object or object, optional) — 에이전트 실행 설정 전체를 교체합니다. 지정하면 model과 voice 단축 필드는 함께 사용할 수 없습니다.
  - 모델 내장 음성
    - `outputMode` (enum, required)
      - Allowed values: `realtime_voice`
    - `llm` (object, required)
      - `provider` (enum, required)
        - Allowed values: `openai-realtime`
      - `model` (enum, required)
        - Allowed values: `gpt-realtime-2.1`, `gpt-realtime-2.1-mini`
      - `voice` (enum, required)
        - Allowed values: `marin`, `cedar`, `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`
    - `language` (string, optional, default: ko)
    - `knowledge` (object, optional)
      - `enabled` (boolean, required)
      - `topK` (integer, required)
  - Realtime과 외부 TTS
    - `outputMode` (enum, required)
      - Allowed values: `external_tts`
    - `llm` (object, required)
      - `provider` (enum, required)
        - Allowed values: `openai-realtime`
      - `model` (enum, required)
        - Allowed values: `gpt-realtime-2.1`, `gpt-realtime-2.1-mini`
    - `tts` (object or object, required)
      - Cartesia
        - `provider` (enum, required)
          - Allowed values: `cartesia`
        - `model` (enum, required)
          - Allowed values: `sonic-3.5`
        - `voice` (string, required)
        - `language` (string, optional, default: ko)
        - `speed` (double, optional)
        - `volume` (double, optional)
      - xAI
        - `provider` (enum, required)
          - Allowed values: `xai`
        - `model` (enum, required)
          - Allowed values: `tts-1`
        - `voice` (string, required)
        - `language` (string, optional, default: ko)
    - `language` (string, optional, default: ko)
    - `knowledge` (object, optional)
      - `enabled` (boolean, required)
      - `topK` (integer, required)
  - STT·LLM·TTS 파이프라인
    - `outputMode` (enum, required)
      - Allowed values: `pipeline`
    - `stt` (object, required)
      - `provider` (enum, required)
        - Allowed values: `openai`
      - `model` (enum, required)
        - Allowed values: `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `whisper-1`
      - `language` (string, optional, default: ko)
      - `prompt` (string, optional)
      - `temperature` (double, optional)
      - `detect_language` (boolean, optional)
      - `noise_reduction_type` (enum, optional)
        - Allowed values: `near_field`, `far_field`
      - `use_realtime` (boolean, optional)
    - `llm` (object, required)
      - `provider` (enum, required)
        - Allowed values: `openai`
      - `model` (enum, required)
        - Allowed values: `gpt-5.6-luna`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5.2`, `gpt-5.1`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`
      - `temperature` (double, optional)
      - `top_p` (double, optional)
      - `verbosity` (enum, optional)
        - Allowed values: `low`, `medium`, `high`
      - `max_completion_tokens` (integer, optional)
      - `frequency_penalty` (double, optional)
      - `presence_penalty` (double, optional)
      - `service_tier` (enum, optional)
        - Allowed values: `auto`, `default`, `flex`, `scale`, `priority`
      - `parallel_tool_calls` (boolean, optional)
      - `seed` (integer, optional)
    - `tts` (object or object, required)
      - Cartesia
        - `provider` (enum, required)
          - Allowed values: `cartesia`
        - `model` (enum, required)
          - Allowed values: `sonic-3.5`
        - `voice` (string, required)
        - `language` (string, optional, default: ko)
        - `speed` (double, optional)
        - `volume` (double, optional)
      - xAI
        - `provider` (enum, required)
          - Allowed values: `xai`
        - `model` (enum, required)
          - Allowed values: `tts-1`
        - `voice` (string, required)
        - `language` (string, optional, default: ko)
    - `language` (string, optional, default: ko)
    - `knowledge` (object, optional)
      - `enabled` (boolean, required)
      - `topK` (integer, required)
    - `vad` (object, optional)
      - `provider` (enum, required)
        - Allowed values: `silero`
      - `min_silence_duration` (double, optional)
      - `min_speech_duration` (double, optional)
      - `prefix_padding_duration` (double, optional)
      - `max_buffered_speech` (double, optional)
      - `activation_threshold` (double, optional)
      - `sample_rate` (enum, optional)
        - Allowed values: `16000`, `8000`
      - `force_cpu` (boolean, optional)
    - `session` (object, optional)
      - `turn_detection` (enum, optional)
        - Allowed values: `vad`, `stt`
      - `allow_interruptions` (boolean, optional)
      - `min_endpointing_delay` (double, optional)
      - `max_endpointing_delay` (double, optional)
      - `min_interruption_duration` (double, optional)

## Response

### 200

수정 성공

- `agentId` (string, required) — 에이전트 ID
- `name` (string, required)
- `instructions` (string, required) — 에이전트 시스템 프롬프트
- `greeting` (boolean, required) — 통화 연결 직후 에이전트가 먼저 인사할지 여부
- `language` (string, required) — 에이전트 기본 언어
- `model` (string, required) — 현재 에이전트가 사용하는 LLM 모델
- `voice` (string, required, nullable) — 현재 음성 ID
- `voiceProvider` (string, required, nullable) — 음성 출력 제공자
- `voiceModel` (string, required, nullable) — 외부 TTS 모델. 모델 내장 음성에서는 null입니다.
- `configuration` (object, required)
  - `outputMode` (enum, required)
    - Allowed values: `realtime_voice`, `external_tts`, `pipeline`
  - `language` (string, required)
  - `knowledge` (object, required)
    - `enabled` (boolean, required)
    - `topK` (integer, required)
  - `stt` (object, required, nullable)
    - `provider` (enum, required)
      - Allowed values: `openai`
    - `model` (enum, required)
      - Allowed values: `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `whisper-1`
    - `language` (string, optional, default: ko)
    - `prompt` (string, optional)
    - `temperature` (double, optional)
    - `detect_language` (boolean, optional)
    - `noise_reduction_type` (enum, optional)
      - Allowed values: `near_field`, `far_field`
    - `use_realtime` (boolean, optional)
  - `llm` (object, required)
    - `provider` (string, required)
    - `model` (string, required)
    - `voice` (string, optional)
  - `tts` (object or object, required, nullable)
    - Cartesia
      - `provider` (enum, required)
        - Allowed values: `cartesia`
      - `model` (enum, required)
        - Allowed values: `sonic-3.5`
      - `voice` (string, required)
      - `language` (string, optional, default: ko)
      - `speed` (double, optional)
      - `volume` (double, optional)
    - xAI
      - `provider` (enum, required)
        - Allowed values: `xai`
      - `model` (enum, required)
        - Allowed values: `tts-1`
      - `voice` (string, required)
      - `language` (string, optional, default: ko)
  - `vad` (object, required, nullable)
    - `provider` (enum, required)
      - Allowed values: `silero`
    - `min_silence_duration` (double, optional)
    - `min_speech_duration` (double, optional)
    - `prefix_padding_duration` (double, optional)
    - `max_buffered_speech` (double, optional)
    - `activation_threshold` (double, optional)
    - `sample_rate` (enum, optional)
      - Allowed values: `16000`, `8000`
    - `force_cpu` (boolean, optional)
  - `session` (object, required, nullable)
    - `turn_detection` (enum, optional)
      - Allowed values: `vad`, `stt`
    - `allow_interruptions` (boolean, optional)
    - `min_endpointing_delay` (double, optional)
    - `max_endpointing_delay` (double, optional)
    - `min_interruption_duration` (double, optional)
- `phoneNumbers` (list of string, required) — 이 에이전트에 착신 연결된 전화번호
- `dateCreated` (datetime, required)
- `dateUpdated` (datetime, required)

## Examples

**Request**

```json
{
  "name": "야간 고객 지원 에이전트"
}
```

**Response**

```json
{
  "agentId": "cmagent123",
  "name": "고객 지원 에이전트",
  "instructions": "당신은 친절하고 유능한 한국어 음성 에이전트입니다. 사용자의 요청을 주의 깊게 듣고 정확하고 간결하게 답하세요.",
  "greeting": true,
  "language": "ko",
  "model": "gpt-realtime-2.1-mini",
  "voice": "7706804e-ea85-443a-968a-b9bf363bdde8",
  "voiceProvider": "cartesia",
  "voiceModel": "sonic-3.5",
  "configuration": {
    "outputMode": "realtime_voice",
    "language": "string",
    "knowledge": {
      "enabled": true,
      "topK": 1
    },
    "stt": {
      "provider": "openai",
      "model": "gpt-4o-transcribe",
      "language": "ko",
      "prompt": "string",
      "temperature": 0.5,
      "detect_language": true,
      "noise_reduction_type": "near_field",
      "use_realtime": true
    },
    "llm": {
      "provider": "string",
      "model": "string",
      "voice": "string"
    },
    "tts": {
      "language": "ko",
      "model": "sonic-3.5",
      "provider": "cartesia",
      "speed": 1.1,
      "voice": "string",
      "volume": 1.1
    },
    "vad": {
      "provider": "silero",
      "min_silence_duration": 1.1,
      "min_speech_duration": 0.5,
      "prefix_padding_duration": 1.1,
      "max_buffered_speech": 1.1,
      "activation_threshold": 0.5,
      "sample_rate": 16000,
      "force_cpu": true
    },
    "session": {
      "turn_detection": "vad",
      "allow_interruptions": true,
      "min_endpointing_delay": 1.1,
      "max_endpointing_delay": 1.1,
      "min_interruption_duration": 1.1
    }
  },
  "phoneNumbers": [
    "07012340001"
  ],
  "dateCreated": "2024-01-15T09:30:00Z",
  "dateUpdated": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python Agents_updateAgent_example
import requests

url = "https://api.claw-ops.com/v1/accounts/accountId/agents/agentId"

payload = { "name": "야간 고객 지원 에이전트" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Agents_updateAgent_example
const url = 'https://api.claw-ops.com/v1/accounts/accountId/agents/agentId';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"야간 고객 지원 에이전트"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Agents_updateAgent_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.claw-ops.com/v1/accounts/accountId/agents/agentId"

	payload := strings.NewReader("{\n  \"name\": \"야간 고객 지원 에이전트\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Agents_updateAgent_example
require 'uri'
require 'net/http'

url = URI("https://api.claw-ops.com/v1/accounts/accountId/agents/agentId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"야간 고객 지원 에이전트\"\n}"

response = http.request(request)
puts response.read_body
```

```java Agents_updateAgent_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.claw-ops.com/v1/accounts/accountId/agents/agentId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"야간 고객 지원 에이전트\"\n}")
  .asString();
```

```php Agents_updateAgent_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.claw-ops.com/v1/accounts/accountId/agents/agentId', [
  'body' => '{
  "name": "야간 고객 지원 에이전트"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Agents_updateAgent_example
using RestSharp;

var client = new RestClient("https://api.claw-ops.com/v1/accounts/accountId/agents/agentId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"야간 고객 지원 에이전트\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Agents_updateAgent_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["name": "야간 고객 지원 에이전트"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.claw-ops.com/v1/accounts/accountId/agents/agentId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```