> 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/campaigns

워크스페이스의 아웃바운드 캠페인을 최신순으로 나열합니다.

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

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

### Query parameters

- `page_size` (integer, optional, default: 100) — 반환할 최대 항목 수입니다.
- `status` (enum, optional) — 이 상태 중 하나에 해당하는 캠페인만 포함합니다.
  - Allowed values: `active`, `paused`, `stopping`, `stopped`, `completed`, `failed`, `attention`
- `agent_id` (string, optional) — 이 에이전트가 실행한 캠페인만 포함합니다.
- `channel` (enum, optional) — 이 채널의 캠페인만 포함합니다.
  - Allowed values: `phone`, `whatsapp`
- `mode` (enum, optional) — 음성 캠페인 또는 메시지 캠페인만 포함합니다.
  - Allowed values: `voice`, `message`
- `search` (string, optional) — 이 텍스트가 이름에 포함된 캠페인만 포함합니다.
- `cursor` (string, optional) — 다음 페이지를 가져오는 데 사용됩니다. 응답에서 커서가 반환됩니다.

## Response

### 200

성공 응답

- `campaigns` (list of CampaignResponse, required)
- `has_more` (boolean, required)
- `next_cursor` (string, optional)

## Errors

### 422 Outbound Campaigns List Request Unprocessable Entity Error

유효성 검사 오류

- `detail` (list of ValidationError, optional)

## Types

### CampaignResponse

- `campaign_id` (string, required)
- `call_name` (string, required) — 캠페인 이름입니다.
- `agent_id` (string, required)
- `channel_config` (CampaignResponseChannelConfig, required)
- `status` (enum, required) — `attention`은 해결되지 않은 주의 항목으로 인해 캠페인의 일부 통화가 보류되고 나머지는 진행됨을 의미합니다. `stopping`은 대기 중인 통화가 취소되고 이미 시작된 통화는 마무리 중임을 의미합니다.
  - Allowed values: `active`, `paused`, `stopping`, `stopped`, `completed`, `failed`, `attention`
- `policy` (CampaignPolicySnapshot, required) — 캠페인 생성 시 적용된 정책입니다.
- `variant` (enum, required)
  - Allowed values: `simple`, `advanced`
- `created_at_unix` (integer, required)
- `updated_at_unix` (integer, required)
- `channel` (enum, required)
  - Allowed values: `phone`, `whatsapp`
- `mode` (enum, required)
  - Allowed values: `voice`, `message`
- `counts` (CampaignSummaryCounts, required)
- `agent_name` (string, required, default: )
- `source` (enum, optional) — 캠페인이 앱에서 생성되었는지 API를 통해 생성되었는지 여부입니다.
  - Allowed values: `ui`, `api`
- `outcome` (CampaignResponseOutcome, optional) — 캠페인 통화에서 성공으로 간주되는 결과입니다.
- `scheduled_time_unix` (integer, optional) — 캠페인이 통화를 시작하는 시점입니다. 설정하지 않으면 생성 즉시 시작합니다.
- `branch_id` (string, optional) — 캠페인이 통화에 사용하는 에이전트 브랜치입니다.
- `environment` (string, optional) — 에이전트 환경 변수를 해석하는 환경입니다.
- `target_concurrency_limit` (integer, optional) — 캠페인이 동시에 시작할 수 있는 최대 통화 수입니다.

### ValidationError

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

### CampaignResponseChannelConfig

- `channel`: `phone`
  - `agent_phone_number_id` (string, required) — 발신에 사용할 전화번호입니다.
  - `mode_config` (PhoneVoiceConfigOutput, optional)
- `channel`: `whatsapp`
  - `mode_config` (WhatsAppChannelConfigModeConfig, required)
  - `whatsapp_phone_number_id` (string, required) — 통화를 걸거나 메시지를 보낼 때 사용할 WhatsApp 전화번호입니다.

### CampaignPolicySnapshot

캠페인 생성 시 적용된 정책이며, 제출된 `policy`와 같은 형식으로 제공됩니다.

- `timezone` (string, required)
- `retry` (RetryPolicy, required)
- `calling_periods` (list of CallingPeriodPolicy, required)
- `data_collection` (DataCollectionPolicy, required)
- `followup_context` (FollowupContextPolicy, required) — 후속 통화에 전달할 `campaign__` 동적 변수입니다.

### CampaignSummaryCounts

- `leads` (integer, required)
- `terminal_leads` (integer, required) — 더 이상 통화하지 않을 리드입니다.
- `open_attention` (integer, required) — 아직 해결되지 않은 주의 항목입니다.
- `delivery` (RecipientDeliveryCounts, optional) — 각 단계에 도달한 메시지 수입니다. 메시지 캠페인 하나를 조회할 때 설정됩니다.

### CampaignResponseOutcome

- `type`: `data_collection`
  - `data_collection_id` (string, required) — 성공한 통화에서 설정하는 에이전트의 데이터 수집 항목입니다.
  - `equals` (list of DataCollectionOutcomeEqualsItem, required) — 성공으로 간주되는 값이며, 모두 해당 항목의 유형입니다.
- `type`: `evaluation_criteria`
  - `criteria_id` (string, required) — 성공한 통화가 충족하는 에이전트의 평가 기준입니다.

### ValidationErrorLocItem

- string
- integer

### PhoneVoiceConfigOutput

- `ringing_timeout_secs` (integer, optional, default: 60) — 포기하기 전에 수신자에게 벨을 울릴 시간(초)입니다. 제공업체 자체 제한도 적용됩니다.
- `twilio_call_recording_enabled` (boolean, optional, default: false) — Twilio 통화 녹음을 사용해 통화를 녹음할지 여부입니다. Twilio 이외의 제공업체에서는 무시됩니다. 녹음은 Twilio 계정에 저장됩니다.
- `twilio_machine_detection` (TwilioMachineDetectionConfig, optional) — Twilio의 통신사 수준 자동 응답기 감지(AMD)를 위한 구성입니다. 비활성화하려면 생략하거나 null로 설정하세요. Twilio 이외의 제공업체 및 수신 통화에서는 무시됩니다. 결과 판정은 별도의 `answering_machine_detection` 웹훅 이벤트로 전달되며, 이 이벤트는 워크스페이스 또는 에이전트 웹훅 설정에서 활성화해야 합니다. 이는 대화 또는 통화 후 웹훅의 일부가 아닙니다. 감지는 비동기적으로 실행되므로 대화 시작을 지연시키지 않으며, 판정은 통화 중 언제든지 도착할 수 있습니다. `detect_message_end`를 사용하면 통화가 종료된 후에도 도착할 수 있습니다. Twilio는 AMD에 대해 별도로 요금을 청구합니다.
- `mode` ("voice", optional)

### WhatsAppChannelConfigModeConfig

- `mode`: `message`
  - `template` (WhatsAppTemplate, required) — 제출 시 승인된 상태의 Meta 템플릿입니다.
- `mode`: `voice`
  - `whatsapp_call_permission_request_template_language_code` (string, required) — 해당 템플릿의 언어 코드입니다.
  - `whatsapp_call_permission_request_template_name` (string, required) — 연락처에 통화 허가를 요청하는 승인된 템플릿입니다.

### 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`만 적용됩니다.

### CallingPeriodPolicy

- `weekdays` (list of integer, required)
- `intervals` (list of CallingIntervalPolicy, required) — 각 요일의 시간대입니다. 어떤 요일에서도 서로 겹칠 수 없습니다.

### DataCollectionPolicy

- `callback_time` (string, optional)
- `redirect_phone_number` (string, optional)
- `stop` (string, optional)
- `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`로 전달합니다.

### RecipientDeliveryCounts

- `sent` (integer, optional, default: 0)
- `delivered` (integer, optional, default: 0)
- `read` (integer, optional, default: 0)
- `replied` (integer, optional, default: 0)
- `failed` (integer, optional, default: 0)

### DataCollectionOutcomeEqualsItem

- string
- integer
- double
- boolean

### TwilioMachineDetectionConfig

통화에서 Twilio의 통신사 수준 자동응답기 감지(AMD)를 실행하는 방식입니다.

- `mode` (enum, optional, default: enable) — 감지 수준을 설정합니다. `enable`은 Twilio가 사람과 기계를 구분할 수 있는 즉시 판정을 반환합니다. `detect_message_end`는 음성 사서함 인사말이 끝날 때까지도 기다리며, 이때 `machine_end_*` 판정이 생성되지만 결과 반환은 더 늦어집니다.
  - Allowed values: `enable`, `detect_message_end`
- `actions` (list of TwilioMachineDetectionRule, optional) — AMD 판정별로 통화에서 수행할 작업입니다. 각 작업은 최대 하나의 규칙에만 포함될 수 있으므로, 해당 작업의 모든 판정을 함께 나열하세요. 규칙이 없는 판정에서는 통화가 계속 진행됩니다.

### WhatsAppTemplate

- `name` (string, required)
- `language` (string, required) — https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/supported-languages
- `components` (list of WhatsAppTemplateComponent, required)
- `parameter_format` (enum, optional, default: POSITIONAL)
  - Allowed values: `POSITIONAL`, `NAMED`
- `category` (string, optional) — https://developers.facebook.com/docs/graph-api/reference/whats-app-business-account/message_templates/

### CallingIntervalPolicy

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

### TwilioMachineDetectionRule

지정된 AMD 판정에 따라 진행 중인 통화에서 수행할 작업입니다.

- `action` ("hang_up", required)
- `answered_by` (list of enum, required) — 작업을 트리거하는 판정입니다.
  - Allowed values: `human`, `fax`, `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`

### WhatsAppTemplateComponent

- `type` (string, required)
- `format` (string, optional)
- `text` (string, optional)
- `buttons` (list of WhatsAppTemplateComponentButton, optional)

### WhatsAppTemplateComponentButton

- `type` (string, required)
- `text` (string, optional)
- `url` (string, optional)

## Examples

**Response**

```json
{
  "campaigns": [
    {
      "campaign_id": "campaign_id",
      "call_name": "call_name",
      "agent_id": "agent_id",
      "channel_config": {
        "channel": "phone",
        "agent_phone_number_id": "agent_phone_number_id"
      },
      "status": "active",
      "policy": {
        "timezone": "timezone",
        "retry": {},
        "calling_periods": [
          {
            "weekdays": [
              1
            ],
            "intervals": [
              {
                "start": "start",
                "end": "end"
              }
            ]
          }
        ],
        "data_collection": {},
        "followup_context": {}
      },
      "variant": "simple",
      "created_at_unix": 1,
      "updated_at_unix": 1,
      "channel": "phone",
      "mode": "voice",
      "counts": {
        "leads": 1,
        "terminal_leads": 1,
        "open_attention": 1
      },
      "agent_name": "agent_name",
      "source": "ui",
      "outcome": {
        "type": "data_collection",
        "data_collection_id": "data_collection_id",
        "equals": [
          "equals"
        ]
      },
      "scheduled_time_unix": 1,
      "branch_id": "branch_id",
      "environment": "environment",
      "target_concurrency_limit": 1
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}
```

**SDK Code**

```python
import requests

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

querystring = {"agent_id":"agent_id","channel":"phone","cursor":"cursor","mode":"voice","page_size":"1","search":"search","status":"[\"active\"]"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns?agent_id=agent_id&channel=phone&cursor=cursor&mode=voice&page_size=1&search=search&status=%5B%22active%22%5D';
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/campaigns?agent_id=agent_id&channel=phone&cursor=cursor&mode=voice&page_size=1&search=search&status=%5B%22active%22%5D"

	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/campaigns?agent_id=agent_id&channel=phone&cursor=cursor&mode=voice&page_size=1&search=search&status=%5B%22active%22%5D")

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/campaigns?agent_id=agent_id&channel=phone&cursor=cursor&mode=voice&page_size=1&search=search&status=%5B%22active%22%5D")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns?agent_id=agent_id&channel=phone&cursor=cursor&mode=voice&page_size=1&search=search&status=%5B%22active%22%5D');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns?agent_id=agent_id&channel=phone&cursor=cursor&mode=voice&page_size=1&search=search&status=%5B%22active%22%5D");
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/campaigns?agent_id=agent_id&channel=phone&cursor=cursor&mode=voice&page_size=1&search=search&status=%5B%22active%22%5D")! 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()
```