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

# アウトバウンドキャンペーンを再開

POST https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns/{campaign_id}/resume

一時停止中のアウトバウンドキャンペーンを、対応項目によって保留されていた通話も含めて再開します。

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

## 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`
- `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) — キャンペーンが同時に発信する最大通話数。

## Errors

### 422 Outbound Campaigns Resume Request Unprocessable Entity Error

検証エラー

- `detail` (list of ValidationError, optional)

## Types

### 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) — 各段階に到達したメッセージ数。メッセージキャンペーンを1件取得する際に設定されます。

### CampaignResponseOutcome

- `type`: `data_collection`
  - `data_collection_id` (string, required) — 通話が成功したときに設定されるエージェントのデータ収集項目。
  - `equals` (list of DataCollectionOutcomeEqualsItem, required) — 成功と見なされる値。すべて項目と同じ型である必要があります。
- `type`: `evaluation_criteria`
  - `criteria_id` (string, required) — 通話が成功したときに満たされるエージェントの評価基準。

### ValidationError

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

### 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`Webhookイベントとして配信され、このイベントをワークスペースまたはエージェントのWebhook設定で有効にする必要があります。会話または通話後Webhookの一部ではありません。検出は非同期で実行されるため、会話の開始が遅延することはありません。結果は通話中の任意の時点で届く可能性があり、`detect_message_end`では通話終了後に届くこともあります。AMDにはTwilioから別途料金が請求されます。
- `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) — 通話に失敗した後、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` のみが適用されます。

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

### ValidationErrorLocItem

- 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判定ごとに通話で実行するアクション。各アクションは最大1つのルールにのみ指定できるため、該当するすべての判定をまとめて列挙してください。ルールのない判定では通話は継続します。

### 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`は深夜0時に終了します。

### 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
{
  "campaign_id": "campaign_id",
  "call_name": "call_name",
  "agent_id": "agent_id",
  "channel_config": {
    "channel": "phone",
    "agent_phone_number_id": "agent_phone_number_id",
    "mode_config": {
      "ringing_timeout_secs": 1,
      "twilio_call_recording_enabled": true,
      "mode": "voice"
    }
  },
  "status": "active",
  "policy": {
    "timezone": "timezone",
    "retry": {
      "retry_delay_seconds": 1,
      "max_short_retries": 1,
      "max_total_calls": 1,
      "max_callbacks": 1,
      "max_redirects": 1,
      "interval_placement": "start",
      "rotate_step_seconds": 1,
      "max_consecutive_failures_per_number": 1
    },
    "calling_periods": [
      {
        "weekdays": [
          1
        ],
        "intervals": [
          {
            "start": "start",
            "end": "end"
          }
        ]
      }
    ],
    "data_collection": {
      "callback_time": "callback_time",
      "redirect_phone_number": "redirect_phone_number",
      "stop": "stop",
      "mappings": {
        "key": "value"
      }
    },
    "followup_context": {
      "call_type": true,
      "previous_conversation_id": true,
      "previous_summary": true,
      "previous_transcript": true
    }
  },
  "variant": "simple",
  "created_at_unix": 1,
  "updated_at_unix": 1,
  "channel": "phone",
  "mode": "voice",
  "counts": {
    "leads": 1,
    "terminal_leads": 1,
    "open_attention": 1,
    "delivery": {
      "sent": 1,
      "delivered": 1,
      "read": 1,
      "replied": 1,
      "failed": 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
}
```

**SDK Code**

```python
import requests

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

response = requests.post(url)

print(response.json())
```

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

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/resume"

	req, _ := http.NewRequest("POST", 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/resume")

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

request = Net::HTTP::Post.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.post("https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns/campaign_id/resume")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/outbound-campaigns/campaigns/campaign_id/resume");
var request = new RestRequest(Method.POST);
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/resume")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

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