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

# 콜 플로우 전체 교체

PUT https://api.claw-ops.com/v1/accounts/{accountId}/call-flows/{callFlowId}
Content-Type: application/json

플로우를 통째로 바꿉니다. `name`·`graph` 둘 다 필수이고, 보낸 그래프가 저장된 그래프를
**완전히 대체**합니다.

콘솔 빌더가 잡아 둔 캔버스 좌표는 **버려집니다**(REST의 PUT 의미 그대로). 좌표가 없어도
콘솔 에디터가 자동 배치로 받아주므로 화면이 깨지지는 않습니다. 좌표를 지키려면 `PATCH`를 쓰세요.

검증과 에러 형태는 생성(POST)과 같습니다.

Reference: https://docs.claw-ops.com/api-레퍼런스/claw-ops-api/call-flows/replace-call-flow

## Authentication

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

## Request

### Path parameters

- `accountId` (string, required) — 계정 ID
- `callFlowId` (string, required) — 콜 플로우 ID

### Body (application/json)

- `name` (string, required) — 플로우 이름
- `graph` (object, required) — 콜 플로우 그래프 — **요청용**. 블럭(`nodes`)과 시작점(`start`)으로 통화 흐름 전체를 기술합니다. ⚠️ **요청과 응답의 형태가 다릅니다.** 기본값이 있는 필드(`menu.maxDigits`·`menu.timeoutSec`, `record.maxLengthSec`·`playBeep`·`finishKey`, `dial.timeoutSec`, `voice.language`, `optout.number`·`channel`)는 요청에서 **생략할 수 있고**, 응답에는 **항상 채워져** 돌아옵니다. 캔버스 좌표(`ui`)는 공개 계약 밖입니다 — 보내도 저장되지 않고, 응답에도 실리지 않습니다. 콘솔 빌더가 잡아 둔 좌표는 `PUT`이면 버려지고 `PATCH`면 보존됩니다. 그래프 전체는 256KB를 넘을 수 없습니다.
  - `version` (enum, required)
    - Allowed values: `1`
  - `start` (string, required) — 시작 블럭 id
  - `nodes` (map from string to object, required) — 블럭 id → 블럭
    - `type` (enum, required) — 블럭 종류
      - Allowed values: `say`, `play`, `pause`, `message`, `menu`, `record`, `dial`, `hangup`, `setvar`, `condition`, `http`, `optout`
  - `voice` (object, optional) — 플로우 전역 음성. 이 플로우의 모든 멘트를 이 목소리가 읽습니다. 생략하면 기본(무료) 음성입니다. `google`은 무료이고 `cartesia`·`elevenlabs`는 유료입니다. 다른 조직이 등록한 복제 음성 id는 403(`call_flow_voice_forbidden`)으로 거절합니다.
    - `provider` (enum, required) — TTS 공급자
      - Allowed values: `google`, `cartesia`, `elevenlabs`
    - `voiceId` (string, optional) — 유료 공급자의 음성 id (cartesia=카탈로그 UUID · elevenlabs=20자 영숫자)
    - `model` (string, optional) — 공급자 모델. **ElevenLabs 전용** — 다른 공급자에 붙이면 400입니다.
    - `language` (string, optional) — 언어 코드. 요청에서 생략하면 `ko`로 채워집니다.
    - `controls` (object, optional) — 음색 튜닝. 공급자가 지원하지 않는 값은 통화에 태우지 않고 저장만 합니다.
      - `speed` (double, optional)
      - `volume` (double, optional)

## Response

### 200

교체 성공

- `callFlowId` (string, optional) — 콜 플로우 ID. createCall의 CallFlowId, 번호 라우팅의 callFlowId에 그대로 사용합니다.
- `name` (string, optional) — 콜 플로우 이름
- `phoneNumbers` (list of string, optional) — 이 플로우로 인입되는 번호 목록(routingType=callflow). 아웃바운드 전용이면 빈 배열입니다.
- `variables` (list of string, optional) — 발신 시 createCall의 Variables로 **넣어야 하는** 변수 이름들. 그래프가 `{{이름}}`으로 참조하지만 통화 중에는 만들어지지 않는 값입니다(누른 키·HTTP 응답·녹음 결과처럼 통화가 만들어내는 변수는 제외). 채우지 않으면 그 자리는 빈 문자열로 나갑니다.
- `dateCreated` (datetime, optional)
- `dateUpdated` (datetime, optional)
- `graph` (object, optional, nullable) — 블럭 구성. 저장된 그래프가 현재 스키마로 읽히지 않으면(콘솔이 아닌 경로로 손댄 아주 오래된 플로우) `null`입니다 — 이름·연결된 번호는 그대로 유효하며, 이 경우 `PUT`으로 그래프 전체를 다시 올려 고칠 수 있습니다.
  - `version` (enum, required)
    - Allowed values: `1`
  - `start` (string, required) — 시작 블럭 id
  - `nodes` (map from string to object, required) — 블럭 id → 블럭
    - `type` (enum, required) — 블럭 종류
      - Allowed values: `say`, `play`, `pause`, `message`, `menu`, `record`, `dial`, `hangup`, `setvar`, `condition`, `http`, `optout`
  - `voice` (object, optional) — 플로우 전역 음성. 이 플로우의 모든 멘트를 이 목소리가 읽습니다. 생략하면 기본(무료) 음성입니다. `google`은 무료이고 `cartesia`·`elevenlabs`는 유료입니다. 다른 조직이 등록한 복제 음성 id는 403(`call_flow_voice_forbidden`)으로 거절합니다.
    - `provider` (enum, required) — TTS 공급자
      - Allowed values: `google`, `cartesia`, `elevenlabs`
    - `voiceId` (string, optional) — 유료 공급자의 음성 id (cartesia=카탈로그 UUID · elevenlabs=20자 영숫자)
    - `model` (string, optional) — 공급자 모델. **ElevenLabs 전용** — 다른 공급자에 붙이면 400입니다.
    - `language` (string, optional) — 언어 코드. 요청에서 생략하면 `ko`로 채워집니다.
    - `controls` (object, optional) — 음색 튜닝. 공급자가 지원하지 않는 값은 통화에 태우지 않고 저장만 합니다.
      - `speed` (double, optional)
      - `volume` (double, optional)

## Examples

**Request**

```json
{
  "name": "동의 확인 ARS (문구 수정)",
  "graph": {
    "version": 1,
    "start": "ask",
    "nodes": {
      "agreed": {
        "type": "hangup",
        "message": "동의해 주셔서 감사합니다."
      },
      "ask": {
        "type": "menu",
        "branches": {
          "1": "agreed",
          "2": "declined"
        },
        "invalidNext": null,
        "prompt": "안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.",
        "saveAs": "consent",
        "timeoutNext": "noInput"
      },
      "declined": {
        "type": "hangup",
        "message": "확인했습니다. 감사합니다."
      },
      "noInput": {
        "type": "hangup",
        "message": "입력이 없어 통화를 종료합니다."
      }
    }
  }
}
```

**Response**

```json
{
  "callFlowId": "cmryw3ycm000001s6on0kp9a8",
  "name": "고객센터 ARS",
  "phoneNumbers": [
    "07052753864"
  ],
  "variables": [
    "name"
  ],
  "dateCreated": "2026-07-24T09:12:33.000Z",
  "dateUpdated": "2026-07-27T01:40:11.000Z",
  "graph": {
    "version": 1,
    "start": "greeting",
    "nodes": {
      "bye": {
        "type": "hangup",
        "message": "이용해 주셔서 감사합니다."
      },
      "greeting": {
        "type": "say",
        "next": "bye",
        "text": "안녕하세요, 클로옵스입니다."
      }
    },
    "voice": {
      "provider": "google",
      "language": "ko"
    }
  }
}
```

**SDK Code**

```python CallFlows_replaceCallFlow_example
import requests

url = "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8"

payload = {
    "name": "동의 확인 ARS (문구 수정)",
    "graph": {
        "version": 1,
        "start": "ask",
        "nodes": {
            "agreed": {
                "type": "hangup",
                "message": "동의해 주셔서 감사합니다."
            },
            "ask": {
                "type": "menu",
                "branches": {
                    "1": "agreed",
                    "2": "declined"
                },
                "invalidNext": None,
                "prompt": "안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.",
                "saveAs": "consent",
                "timeoutNext": "noInput"
            },
            "declined": {
                "type": "hangup",
                "message": "확인했습니다. 감사합니다."
            },
            "noInput": {
                "type": "hangup",
                "message": "입력이 없어 통화를 종료합니다."
            }
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript CallFlows_replaceCallFlow_example
const url = 'https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"동의 확인 ARS (문구 수정)","graph":{"version":1,"start":"ask","nodes":{"agreed":{"type":"hangup","message":"동의해 주셔서 감사합니다."},"ask":{"type":"menu","branches":{"1":"agreed","2":"declined"},"invalidNext":null,"prompt":"안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.","saveAs":"consent","timeoutNext":"noInput"},"declined":{"type":"hangup","message":"확인했습니다. 감사합니다."},"noInput":{"type":"hangup","message":"입력이 없어 통화를 종료합니다."}}}}'
};

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

```go CallFlows_replaceCallFlow_example
package main

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

func main() {

	url := "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8"

	payload := strings.NewReader("{\n  \"name\": \"동의 확인 ARS (문구 수정)\",\n  \"graph\": {\n    \"version\": 1,\n    \"start\": \"ask\",\n    \"nodes\": {\n      \"agreed\": {\n        \"type\": \"hangup\",\n        \"message\": \"동의해 주셔서 감사합니다.\"\n      },\n      \"ask\": {\n        \"type\": \"menu\",\n        \"branches\": {\n          \"1\": \"agreed\",\n          \"2\": \"declined\"\n        },\n        \"invalidNext\": null,\n        \"prompt\": \"안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.\",\n        \"saveAs\": \"consent\",\n        \"timeoutNext\": \"noInput\"\n      },\n      \"declined\": {\n        \"type\": \"hangup\",\n        \"message\": \"확인했습니다. 감사합니다.\"\n      },\n      \"noInput\": {\n        \"type\": \"hangup\",\n        \"message\": \"입력이 없어 통화를 종료합니다.\"\n      }\n    }\n  }\n}")

	req, _ := http.NewRequest("PUT", 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 CallFlows_replaceCallFlow_example
require 'uri'
require 'net/http'

url = URI("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"동의 확인 ARS (문구 수정)\",\n  \"graph\": {\n    \"version\": 1,\n    \"start\": \"ask\",\n    \"nodes\": {\n      \"agreed\": {\n        \"type\": \"hangup\",\n        \"message\": \"동의해 주셔서 감사합니다.\"\n      },\n      \"ask\": {\n        \"type\": \"menu\",\n        \"branches\": {\n          \"1\": \"agreed\",\n          \"2\": \"declined\"\n        },\n        \"invalidNext\": null,\n        \"prompt\": \"안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.\",\n        \"saveAs\": \"consent\",\n        \"timeoutNext\": \"noInput\"\n      },\n      \"declined\": {\n        \"type\": \"hangup\",\n        \"message\": \"확인했습니다. 감사합니다.\"\n      },\n      \"noInput\": {\n        \"type\": \"hangup\",\n        \"message\": \"입력이 없어 통화를 종료합니다.\"\n      }\n    }\n  }\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"동의 확인 ARS (문구 수정)\",\n  \"graph\": {\n    \"version\": 1,\n    \"start\": \"ask\",\n    \"nodes\": {\n      \"agreed\": {\n        \"type\": \"hangup\",\n        \"message\": \"동의해 주셔서 감사합니다.\"\n      },\n      \"ask\": {\n        \"type\": \"menu\",\n        \"branches\": {\n          \"1\": \"agreed\",\n          \"2\": \"declined\"\n        },\n        \"invalidNext\": null,\n        \"prompt\": \"안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.\",\n        \"saveAs\": \"consent\",\n        \"timeoutNext\": \"noInput\"\n      },\n      \"declined\": {\n        \"type\": \"hangup\",\n        \"message\": \"확인했습니다. 감사합니다.\"\n      },\n      \"noInput\": {\n        \"type\": \"hangup\",\n        \"message\": \"입력이 없어 통화를 종료합니다.\"\n      }\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8', [
  'body' => '{
  "name": "동의 확인 ARS (문구 수정)",
  "graph": {
    "version": 1,
    "start": "ask",
    "nodes": {
      "agreed": {
        "type": "hangup",
        "message": "동의해 주셔서 감사합니다."
      },
      "ask": {
        "type": "menu",
        "branches": {
          "1": "agreed",
          "2": "declined"
        },
        "invalidNext": null,
        "prompt": "안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.",
        "saveAs": "consent",
        "timeoutNext": "noInput"
      },
      "declined": {
        "type": "hangup",
        "message": "확인했습니다. 감사합니다."
      },
      "noInput": {
        "type": "hangup",
        "message": "입력이 없어 통화를 종료합니다."
      }
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp CallFlows_replaceCallFlow_example
using RestSharp;

var client = new RestClient("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"동의 확인 ARS (문구 수정)\",\n  \"graph\": {\n    \"version\": 1,\n    \"start\": \"ask\",\n    \"nodes\": {\n      \"agreed\": {\n        \"type\": \"hangup\",\n        \"message\": \"동의해 주셔서 감사합니다.\"\n      },\n      \"ask\": {\n        \"type\": \"menu\",\n        \"branches\": {\n          \"1\": \"agreed\",\n          \"2\": \"declined\"\n        },\n        \"invalidNext\": null,\n        \"prompt\": \"안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.\",\n        \"saveAs\": \"consent\",\n        \"timeoutNext\": \"noInput\"\n      },\n      \"declined\": {\n        \"type\": \"hangup\",\n        \"message\": \"확인했습니다. 감사합니다.\"\n      },\n      \"noInput\": {\n        \"type\": \"hangup\",\n        \"message\": \"입력이 없어 통화를 종료합니다.\"\n      }\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift CallFlows_replaceCallFlow_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "동의 확인 ARS (문구 수정)",
  "graph": [
    "version": 1,
    "start": "ask",
    "nodes": [
      "agreed": [
        "type": "hangup",
        "message": "동의해 주셔서 감사합니다."
      ],
      "ask": [
        "type": "menu",
        "branches": [
          "1": "agreed",
          "2": "declined"
        ],
        "invalidNext": ,
        "prompt": "안내에 동의하시면 1번, 거부하시면 2번을 눌러주세요.",
        "saveAs": "consent",
        "timeoutNext": "noInput"
      ],
      "declined": [
        "type": "hangup",
        "message": "확인했습니다. 감사합니다."
      ],
      "noInput": [
        "type": "hangup",
        "message": "입력이 없어 통화를 종료합니다."
      ]
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/call-flows/cmryw3ycm000001s6on0kp9a8")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```