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

# アウトバウンドキャンペーンの構成を取得

GET https://api.elevenlabs.io/v1/convai/outbound-campaigns/config

ワークスペースのアウトバウンドキャンペーン設定を取得します。これには、新しいキャンペーンに適用されるデフォルトポリシーと、エージェントごとのオーバーライドが含まれます。

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

## 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)

## Response

### 200

成功レスポンス。

- `version` (integer, required) — 置換するたびに増加します。`expected_version` として送信してください。
- `config` (CampaignConfigOutput, required)

## Errors

### 422 Config Get Request Unprocessable Entity Error

検証エラー

- `detail` (list of ValidationError, optional)

## Types

### 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)

### 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) — 通話に失敗した後、1つの発信時間帯内で許可される再試行回数。使い切ると、次の再試行は次回の発信時間帯まで待機し、その時間帯でカウントがリセットされます。
- `max_total_calls` (integer, optional, default: 6) — 初回を含め、1件のリードに発信する最大通話回数。
- `max_callbacks` (integer, optional, default: 2) — 1つの番号に対して受け付けるコールバックの最大回数。
- `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) — リードがリスト内の次の番号へ移るまで、または次の番号がなく終了するまでに、1つの番号への通話が連続して失敗できる回数です。通話への応答または新しい番号へのリダイレクトがあると、カウントはリセットされます。未設定の場合は`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`は深夜0時に終了します。

## Examples

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

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/outbound-campaigns/config';
const options = {method: 'GET'};

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"
	"net/http"
	"io"
)

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	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::Get.new(url)

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.get("https://api.elevenlabs.io/v1/convai/outbound-campaigns/config")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/outbound-campaigns/config');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/outbound-campaigns/config");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/outbound-campaigns/config")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```