> 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/eleven-agents/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`
- `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 Get 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) — कितने मैसेज हर चरण तक पहुंचे; एक मैसेज अभियान प्राप्त करते समय सेट होता है।

### 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` वेबहुक इवेंट के रूप में दिया जाता है, जिसके लिए उस इवेंट को workspace या एजेंट वेबहुक सेटिंग्स में इनेबल करना ज़रूरी है; यह बातचीत या पोस्ट-कॉल वेबहुक का हिस्सा नहीं है। डिटेक्शन एसिंक्रोनस रूप से चलता है, इसलिए यह बातचीत शुरू होने में कभी देरी नहीं करता, और निर्णय कॉल के दौरान किसी भी समय आ सकता है -- `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

### ValidationErrorLocItem

- string
- integer

### TwilioMachineDetectionConfig

कॉल पर Twilio का कैरियर-लेवल आंसरिंग मशीन डिटेक्शन (AMD) कैसे चलाना है।

- `mode` (enum, optional, default: enable) — डिटेक्शन कितना विस्तृत होना चाहिए। जैसे ही Twilio किसी इंसान और मशीन में अंतर पहचान पाता है, `enable` एक निर्णय लौटाता है। `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
{
  "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"

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