> 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/batch-calling/workspace

現在のワークスペースのすべての一括通話を取得します。

Reference: https://elevenlabs.io/docs/eleven-agents/api-reference/batch-calling/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

- `limit` (integer, optional, default: 100)
- `last_doc` (string, optional)
- `agent_id` (string, optional) — バッチ通話を1つのエージェントに絞り込みます。

## Response

### 200

成功レスポンス。

- `batch_calls` (list of BatchCallResponse, required)
- `next_doc` (string, optional) — バッチ呼び出しをページネーションするために使用する次のドキュメント
- `has_more` (boolean, optional, default: false) — ページネーションで取得できるバッチ呼び出しがさらにあるかどうか

## Errors

### 422 Batch Calls List Request Unprocessable Entity Error

検証エラー

- `detail` (list of ValidationError, optional)

## Types

### BatchCallResponse

- `id` (string, required)
- `name` (string, required)
- `agent_id` (string, required)
- `created_at_unix` (integer, required)
- `scheduled_time_unix` (integer, required)
- `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` (TelephonyCallConfigOutput, required)
- `agent_name` (string, required)
- `phone_number_id` (string, optional)
- `phone_provider` (enum, optional)
  - Allowed values: `twilio`, `sip_trunk`, `exotel`
- `whatsapp_params` (BatchCallWhatsAppParams, optional)
- `branch_id` (string, optional)
- `environment` (string, optional)
- `timezone` (string, optional)
- `target_concurrency_limit` (integer, optional) — このバッチの同時通話数の上限。設定した場合、ディスパッチはワークスペース／エージェントのキャパシティ割合ではなく、この上限に従います。
- `branch_name` (string, optional)

### ValidationError

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

### TelephonyCallConfigOutput

- `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から別途料金が請求されます。

### BatchCallWhatsAppParams

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

### ValidationErrorLocItem

### TwilioMachineDetectionConfig

通話でTwilioのキャリアレベル留守番電話検出（AMD）を実行する方法です。

- `mode` (enum, optional, default: enable) — 検出の詳細度を指定します。`enable`はTwilioが人間と機械を区別できた時点で判定を返します。`detect_message_end`はボイスメールの挨拶が終わるまで待機し、`machine_end_*`判定を生成しますが、結果の返却は遅くなります。
  - Allowed values: `enable`, `detect_message_end`

## Examples

**Response**

```json
{
  "batch_calls": [
    {
      "id": "id",
      "name": "name",
      "agent_id": "agent_id",
      "created_at_unix": 1,
      "scheduled_time_unix": 1,
      "total_calls_dispatched": 1,
      "total_calls_scheduled": 1,
      "total_calls_finished": 1,
      "last_updated_at_unix": 1,
      "status": "pending",
      "retry_count": 1,
      "telephony_call_config": {},
      "agent_name": "agent_name",
      "phone_number_id": "phone_number_id",
      "phone_provider": "twilio",
      "whatsapp_params": {
        "whatsapp_call_permission_request_template_name": "whatsapp_call_permission_request_template_name",
        "whatsapp_call_permission_request_template_language_code": "whatsapp_call_permission_request_template_language_code"
      },
      "branch_id": "branch_id",
      "environment": "environment",
      "timezone": "timezone",
      "target_concurrency_limit": 1,
      "branch_name": "branch_name"
    }
  ],
  "next_doc": "next_doc",
  "has_more": true
}
```

**SDK Code**

```python
import requests

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

querystring = {"agent_id":"agent_id","last_doc":"last_doc","limit":"1"}

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

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/batch-calling/workspace?agent_id=agent_id&last_doc=last_doc&limit=1';
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/batch-calling/workspace?agent_id=agent_id&last_doc=last_doc&limit=1"

	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/batch-calling/workspace?agent_id=agent_id&last_doc=last_doc&limit=1")

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/batch-calling/workspace?agent_id=agent_id&last_doc=last_doc&limit=1")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/batch-calling/workspace?agent_id=agent_id&last_doc=last_doc&limit=1');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/batch-calling/workspace?agent_id=agent_id&last_doc=last_doc&limit=1");
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/batch-calling/workspace?agent_id=agent_id&last_doc=last_doc&limit=1")! 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()
```