> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# 아웃바운드 캠페인 구성 교체

PUT https://api.elevenlabs.io/v1/convai/outbound-campaigns/config
Content-Type: application/json

워크스페이스의 아웃바운드 캠페인 구성을 생성하거나 교체합니다. 마지막으로 조회한 `version`을 `expected_version`으로 보내거나, 첫 구성을 생성하려면 생략합니다. 조회 후 변경된 구성은 교체되지 않습니다. 캠페인은 시작 시 적용된 정책을 유지합니다.

Reference: https://elevenlabs.io/docs/eleven-agents/api-reference/campaigns/config/update

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Body (application/json)

This endpoint expects an object.

- `config` (CampaignConfigInput, required)
- `expected_version` (integer, optional) — 교체할 구성의 `version`입니다. 첫 구성을 생성하는 경우에만 생략합니다.

## Response

### 200

성공 응답

- `version` (integer, required) — 교체할 때마다 증가하며, `expected_version`으로 전송합니다.
- `config` (CampaignConfigOutput, required)

## Errors

### 422 Config Update Request Unprocessable Entity Error

유효성 검사 오류

- `detail` (list of ValidationError, optional)

## Types

### CampaignConfigInput

- `policy` (PolicyConfigInput, optional) — 캠페인에서 자체 정책을 설정하지 않은 경우 적용되는 정책입니다.
- `agent_policies` (map from string to AgentPolicyOverrideInput, optional) — 에이전트 ID를 키로 하는 `policy` 재정의 설정입니다.
- `whatsapp_voice_policy` (AgentPolicyOverrideInput, optional) — 워크스페이스 정책과 에이전트 재정의 설정 사이에 적용되는 WhatsApp 음성 캠페인용 재정의 설정입니다. 생략된 섹션은 WhatsApp 음성의 기본 설정을 따릅니다.

### CampaignConfigOutput

- `policy` (PolicyConfigOutput, optional) — 캠페인에서 자체 정책을 설정하지 않은 경우 적용되는 정책입니다.
- `agent_policies` (map from string to AgentPolicyOverrideOutput, optional) — 에이전트 ID를 키로 하는 `policy` 재정의 설정입니다.
- `whatsapp_voice_policy` (AgentPolicyOverrideOutput, optional) — 워크스페이스 정책과 에이전트 재정의 설정 사이에 적용되는 WhatsApp 음성 캠페인용 재정의 설정입니다. 생략된 섹션은 WhatsApp 음성의 기본 설정을 따릅니다.

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### PolicyConfigInput

- `timezone` (string, optional, default: UTC) — 통화 시간대를 해석하는 데 사용하는 IANA 시간대입니다.
- `retry` (RetryPolicy, optional)
- `calling_periods` (list of CallingPeriod, optional) — 통화를 걸 수 있는 주간 시간대입니다.
- `data_collection` (DataCollectionConfig, optional) — 후속 통화를 결정하는 에이전트의 데이터 수집 항목입니다. 각 항목은 용도에 맞는 기본 제공 항목이 기본값이며, `null`로 설정하면 비활성화됩니다.
- `followup_context` (FollowupContextPolicy, optional) — 후속 통화에 전달할 `campaign__` 동적 변수입니다.

### AgentPolicyOverrideInput

여기에서 설정한 각 섹션은 정책의 해당 섹션 전체를 대체합니다.

- `timezone` (string, optional)
- `retry` (RetryPolicy, optional)
- `calling_periods` (list of CallingPeriod, optional)
- `data_collection` (DataCollectionConfig, optional) — 후속 통화를 결정하는 에이전트의 데이터 수집 항목입니다. 각 항목은 용도에 맞는 기본 제공 항목이 기본값이며, `null`로 설정하면 비활성화됩니다.
- `followup_context` (FollowupContextPolicy, optional) — 후속 통화에 전달할 `campaign__` 동적 변수입니다.

### PolicyConfigOutput

- `timezone` (string, optional, default: UTC) — 통화 시간대를 해석하는 데 사용하는 IANA 시간대입니다.
- `retry` (RetryPolicy, optional)
- `calling_periods` (list of CallingPeriod, optional) — 통화를 걸 수 있는 주간 시간대입니다.
- `data_collection` (DataCollectionConfig, optional) — 후속 통화를 결정하는 에이전트의 데이터 수집 항목입니다. 각 항목은 용도에 맞는 기본 제공 항목이 기본값이며, `null`로 설정하면 비활성화됩니다.
- `followup_context` (FollowupContextPolicy, optional) — 후속 통화에 전달할 `campaign__` 동적 변수입니다.

### AgentPolicyOverrideOutput

여기에서 설정한 각 섹션은 정책의 해당 섹션 전체를 대체합니다.

- `timezone` (string, optional)
- `retry` (RetryPolicy, optional)
- `calling_periods` (list of CallingPeriod, optional)
- `data_collection` (DataCollectionConfig, optional) — 후속 통화를 결정하는 에이전트의 데이터 수집 항목입니다. 각 항목은 용도에 맞는 기본 제공 항목이 기본값이며, `null`로 설정하면 비활성화됩니다.
- `followup_context` (FollowupContextPolicy, optional) — 후속 통화에 전달할 `campaign__` 동적 변수입니다.

### ValidationErrorLocItem

- string
- integer

### RetryPolicy

- `retry_delay_seconds` (integer, optional, default: 600) — 짧은 재시도 전 대기 시간입니다.
- `max_short_retries` (integer, optional, default: 1) — 통화 실패 후 하나의 통화 가능 시간대에서 허용되는 재시도 횟수입니다. 모두 사용하면 다음 재시도는 새로 시작되는 다음 시간대까지 기다립니다.
- `max_total_calls` (integer, optional, default: 6) — 첫 통화를 포함하여 리드가 받을 수 있는 최대 통화 횟수입니다.
- `max_callbacks` (integer, optional, default: 2) — 하나의 번호에 대해 허용할 최대 콜백 횟수입니다.
- `max_redirects` (integer, optional, default: 2) — 리드가 다른 번호로 통화해 달라는 요청을 따를 수 있는 최대 횟수입니다.
- `interval_placement` (enum, optional, default: start) — 연기된 통화를 이후 통화 가능 시간대의 어디에 배치할지 지정합니다. 해당 시간대의 `start`, `random` 시점 또는 그 시간대에서 마지막 통화가 실패한 지점에서 `rotate_step_seconds`만큼 지난 `rotate` 위치를 사용할 수 있습니다.
  - Allowed values: `start`, `random`, `rotate`
- `rotate_step_seconds` (integer, optional, default: 900) — `rotate` 배치가 각 통화를 이동시키는 간격입니다. `rotate`에서만 사용됩니다.
- `max_consecutive_failures_per_number` (integer, optional) — 리드가 다음 등록 번호로 이동하거나 다음 번호가 없으면 종료되기 전에 하나의 번호로 연속 실패할 수 있는 통화 횟수입니다. 통화가 연결되거나 새 번호로 리디렉션되면 횟수가 초기화됩니다. 설정하지 않으면 `max_total_calls`만 적용됩니다.

### CallingPeriod

- `weekdays` (list of integer, required) — 간격이 적용되는 요일입니다. `0`(월요일)부터 `6`(일요일)까지입니다.
- `intervals` (list of CallingIntervalPolicy, required) — 각 요일의 시간대입니다. 어떤 요일에서도 서로 겹칠 수 없습니다.

### DataCollectionConfig

후속 통화를 결정하는 에이전트의 데이터 수집 항목입니다. 각 항목은 용도에 맞는 기본 제공 항목이 기본값이며, `null`로 설정하면 비활성화됩니다.

- `callback_time` (string, optional) — 연락처가 콜백을 요청한 시간을 보관하는 항목입니다.
- `redirect_phone_number` (string, optional) — 연락처가 통화를 요청한 다른 번호를 보관하는 항목입니다.
- `stop` (string, optional) — 연락처가 다시 통화하지 말라고 요청한 경우 true가 되는 항목입니다.
- `mappings` (map from string to string, optional) — 이후 통화에 사용할 수 있도록 데이터 수집 결과를 동적 변수에 복사합니다. 각 키는 데이터 수집 항목 ID이고 값은 변수 이름입니다.

### FollowupContextPolicy

후속 통화에 전달할 `campaign__` 동적 변수입니다.

- `call_type` (boolean, optional, default: true) — 통화 유형을 `campaign__call_type`으로 전달합니다.
- `previous_conversation_id` (boolean, optional, default: true) — 마지막 대화의 ID를 `campaign__previous_conversation_id`으로 전달합니다.
- `previous_summary` (boolean, optional, default: true) — 마지막 대화의 요약을 `campaign__previous_summary`로 전달합니다.
- `previous_transcript` (boolean, optional, default: true) — 마지막 대화의 스크립트를 `campaign__previous_transcript`로 전달합니다.

### CallingIntervalPolicy

- `start` (string, required) — 현지 시작 시간으로, 형식은 `HH:MM`입니다.
- `end` (string, required) — 현지 종료 시간으로, 형식은 `HH:MM`입니다. `24:00`은 자정에 종료됨을 의미합니다.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "version": 1,
  "config": {
    "policy": {
      "timezone": "timezone",
      "calling_periods": [
        {
          "weekdays": [
            1
          ],
          "intervals": [
            {
              "start": "start",
              "end": "end"
            }
          ]
        }
      ]
    },
    "agent_policies": {
      "key": {}
    },
    "whatsapp_voice_policy": {
      "timezone": "timezone",
      "calling_periods": [
        {
          "weekdays": [
            1
          ],
          "intervals": [
            {
              "start": "start",
              "end": "end"
            }
          ]
        }
      ]
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/outbound-campaigns/config"

payload = {}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/outbound-campaigns/config';
const options = {method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{}'};

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

```go
package main

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

func main() {

	url := "https://api.elevenlabs.io/v1/convai/outbound-campaigns/config"

	payload := strings.NewReader("{}")

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

	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
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/convai/outbound-campaigns/config")

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

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

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

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

HttpResponse<String> response = Unirest.put("https://api.elevenlabs.io/v1/convai/outbound-campaigns/config")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.elevenlabs.io/v1/convai/outbound-campaigns/config', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/outbound-campaigns/config");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/outbound-campaigns/config")! 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()
```