> 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/{campaign_id}

아웃바운드 캠페인과 리드 수를 조회합니다.

Reference: https://elevenlabs.io/docs/api-reference/campaigns/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)

## Request

### Path parameters

- `campaign_id` (string, required)

## Response

### 200

성공 응답

- `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`
- `source` (enum, required, nullable) — 캠페인이 앱에서 생성되었는지 API를 통해 생성되었는지 여부입니다.
  - Allowed values: `ui`, `api`
- `outcome` (CampaignResponseOutcome, required, nullable) — 캠페인 통화에서 성공으로 간주되는 결과입니다.
- `created_at_unix` (integer, required)
- `scheduled_time_unix` (integer, required, nullable) — 캠페인이 통화를 시작하는 시점입니다. 설정하지 않으면 생성 즉시 시작합니다.
- `updated_at_unix` (integer, required)
- `branch_id` (string, required, nullable) — 캠페인이 통화에 사용하는 에이전트 브랜치입니다.
- `environment` (string, required, nullable) — 에이전트 환경 변수를 해석하는 환경입니다.
- `target_concurrency_limit` (integer, required, nullable) — 캠페인이 동시에 시작할 수 있는 최대 통화 수입니다.
- `channel` (enum, required)
  - Allowed values: `phone`, `whatsapp`
- `mode` (enum, required)
  - Allowed values: `voice`, `message`
- `counts` (CampaignSummaryCounts, required)
- `agent_name` (string, required, default: )

## Errors

### 422 Unprocessable Entity Error

유효성 검사 오류

- `detail` (list of ValidationError, optional)

## Types

### CampaignResponseChannelConfig

- `channel`: `phone` (PhoneChannelConfig)
  - `agent_phone_number_id` (string, required) — 발신에 사용할 전화번호입니다.
  - `mode_config` (PhoneVoiceConfig-Output, optional)
- `channel`: `whatsapp` (WhatsAppChannelConfig)
  - `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__` 동적 변수입니다.

### CampaignResponseOutcome

캠페인 통화에서 성공으로 간주되는 결과입니다.

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

### CampaignSummaryCounts

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

### ValidationError

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

### PhoneVoiceConfig-Output

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

### WhatsAppChannelConfigModeConfig

- `mode`: `message` (WhatsAppMessageConfig)
  - `template` (WhatsAppTemplate, required) — 제출 시 승인된 상태의 Meta 템플릿입니다.
- `mode`: `voice` (WhatsAppVoiceConfig)
  - `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, nullable) — 리드가 다음 등록 번호로 이동하거나 다음 번호가 없으면 종료되기 전에 하나의 번호로 연속 실패할 수 있는 통화 횟수입니다. 통화가 연결되거나 새 번호로 리디렉션되면 횟수가 초기화됩니다. 설정하지 않으면 `max_total_calls`만 적용됩니다.

### CallingPeriodPolicy

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

### DataCollectionPolicy

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

### CampaignResponseOutcomeDiscriminatorMappingDataCollectionEqualsItems

- string
- integer
- double
- boolean

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

### ValidationErrorLocItems

- string
- integer

### 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, nullable) — 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` (enum, required)
  - Allowed values: `hang_up`
- `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, nullable)
- `text` (string, optional, nullable)
- `buttons` (list of WhatsAppTemplateComponentButton, optional, nullable)

### WhatsAppTemplateComponentButton

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

## Examples

**Response**

```json
{
  "campaign_id": "string",
  "call_name": "string",
  "agent_id": "string",
  "channel_config": {
    "channel": "phone",
    "agent_phone_number_id": "string",
    "mode_config": {
      "ringing_timeout_secs": 60,
      "twilio_call_recording_enabled": false,
      "twilio_machine_detection": {
        "mode": "enable",
        "actions": [
          {
            "action": "hang_up",
            "answered_by": [
              "human"
            ]
          }
        ]
      },
      "mode": "voice"
    }
  },
  "status": "active",
  "policy": {
    "timezone": "string",
    "retry": {
      "retry_delay_seconds": 600,
      "max_short_retries": 1,
      "max_total_calls": 6,
      "max_callbacks": 2,
      "max_redirects": 2,
      "interval_placement": "start",
      "rotate_step_seconds": 900,
      "max_consecutive_failures_per_number": 1
    },
    "calling_periods": [
      {
        "weekdays": [
          1
        ],
        "intervals": [
          {
            "start": "string",
            "end": "string"
          }
        ]
      }
    ],
    "data_collection": {
      "callback_time": "string",
      "redirect_phone_number": "string",
      "stop": "string",
      "mappings": {}
    },
    "followup_context": {
      "call_type": true,
      "previous_conversation_id": true,
      "previous_summary": true,
      "previous_transcript": true
    }
  },
  "variant": "simple",
  "source": "ui",
  "outcome": {
    "type": "evaluation_criteria",
    "criteria_id": "string"
  },
  "created_at_unix": 1,
  "scheduled_time_unix": 1,
  "updated_at_unix": 1,
  "branch_id": "string",
  "environment": "string",
  "target_concurrency_limit": 1,
  "channel": "phone",
  "mode": "voice",
  "counts": {
    "leads": 1,
    "terminal_leads": 1,
    "open_attention": 1,
    "delivery": {
      "sent": 0,
      "delivered": 0,
      "read": 0,
      "replied": 0,
      "failed": 0
    }
  },
  "agent_name": ""
}
```

**SDK Code**

```python
import requests

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

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns/campaign_id';
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/campaign_id"

	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/campaign_id")

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/campaign_id")
  .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/campaign_id');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns/campaign_id");
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/campaign_id")! 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()
```