> 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/batch-calling/{batch_id}/cancel

चल रही बैच कॉल रद्द करें और सभी प्राप्तकर्ताओं का स्टेटस cancelled पर सेट करें।

Reference: https://elevenlabs.io/docs/api-reference/batch-calling/cancel

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

- `batch_id` (string, required)

## Response

### 200

सफल रिस्पॉन्स

- `id` (string, required)
- `phone_number_id` (string, required, nullable)
- `phone_provider` (enum, required, nullable)
  - Allowed values: `twilio`, `sip_trunk`, `exotel`
- `whatsapp_params` (BatchCallWhatsAppParams, required, nullable)
- `name` (string, required)
- `agent_id` (string, required)
- `branch_id` (string, required, nullable)
- `environment` (string, required, nullable)
- `created_at_unix` (integer, required)
- `scheduled_time_unix` (integer, required)
- `timezone` (string, required, nullable)
- `total_calls_dispatched` (integer, required, default: 0)
- `total_calls_scheduled` (integer, required, default: 0)
- `total_calls_finished` (integer, required, default: 0)
- `last_updated_at_unix` (integer, required)
- `status` (enum, required)
  - Allowed values: `pending`, `in_progress`, `completed`, `failed`, `cancelled`
- `retry_count` (integer, required, default: 0)
- `telephony_call_config` (TelephonyCallConfig-Output, required)
- `target_concurrency_limit` (integer, required, nullable) — इस बैच के लिए एक साथ होने वाली कॉल की अधिकतम संख्या। सेट होने पर डिस्पैच, वर्कस्पेस/एजेंट क्षमता प्रतिशत के बजाय इस सीमा से नियंत्रित होता है।
- `agent_name` (string, required)
- `branch_name` (string, required, nullable)

## Errors

### 422 Unprocessable Entity Error

वैलिडेशन एरर

- `detail` (list of ValidationError, optional)

## Types

### BatchCallWhatsAppParams

- `whatsapp_call_permission_request_template_name` (string, required)
- `whatsapp_call_permission_request_template_language_code` (string, required)
- `whatsapp_phone_number_id` (string, optional, nullable)

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

### ValidationError

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

### TwilioMachineDetectionConfig

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

- `mode` (enum, optional, default: enable) — डिटेक्शन कितना विस्तृत होना चाहिए। जैसे ही Twilio किसी इंसान और मशीन में अंतर पहचान पाता है, `enable` एक निर्णय लौटाता है। `detect_message_end` वॉइसमेल ग्रीटिंग खत्म होने तक भी इंतज़ार करता है, जिससे `machine_end_*` निर्णय मिलते हैं, लेकिन नतीजा बाद में लौटता है।
  - Allowed values: `enable`, `detect_message_end`

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "id": "string",
  "phone_number_id": "string",
  "phone_provider": "twilio",
  "whatsapp_params": {
    "whatsapp_call_permission_request_template_name": "string",
    "whatsapp_call_permission_request_template_language_code": "string",
    "whatsapp_phone_number_id": "string"
  },
  "name": "string",
  "agent_id": "string",
  "branch_id": "string",
  "environment": "string",
  "created_at_unix": 1,
  "scheduled_time_unix": 1,
  "timezone": "string",
  "total_calls_dispatched": 0,
  "total_calls_scheduled": 0,
  "total_calls_finished": 0,
  "last_updated_at_unix": 1,
  "status": "pending",
  "retry_count": 0,
  "telephony_call_config": {
    "ringing_timeout_secs": 60,
    "twilio_call_recording_enabled": false,
    "twilio_machine_detection": {
      "mode": "enable"
    }
  },
  "target_concurrency_limit": 1,
  "agent_name": "string",
  "branch_name": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/batch-calling/batch_id/cancel"

response = requests.post(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/batch-calling/batch_id/cancel';
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/batch-calling/batch_id/cancel"

	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/batch-calling/batch_id/cancel")

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/batch-calling/batch_id/cancel")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.elevenlabs.io/v1/convai/batch-calling/batch_id/cancel');

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

```csharp
using RestSharp;

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