cURL
curl --request POST 'https://api.brightalk.ai/batches' \
--header "Authorization: Bearer $BRIGHTALK_API_KEY" \
--header "Brightalk-Version: 2026-07-16" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: createBatch-example-001" \
--data '{"name":"Renewal reminders","agent_id":"agt_demo_001","contact_ids":["con_demo_001","con_demo_002"]}'const response = await fetch("https://api.brightalk.ai/batches", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BRIGHTALK_API_KEY}`,
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createBatch-example-001",
},
body: JSON.stringify({"name":"Renewal reminders","agent_id":"agt_demo_001","contact_ids":["con_demo_001","con_demo_002"]}),
});
console.log(response.status, await response.json());import os
import requests
response = requests.request(
"POST",
"https://api.brightalk.ai/batches",
headers={
"Authorization": f"Bearer {os.environ['BRIGHTALK_API_KEY']}",
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createBatch-example-001",
},
json={"name":"Renewal reminders","agent_id":"agt_demo_001","contact_ids":["con_demo_001","con_demo_002"]},
)
print(response.status_code, response.json()){
"id": "bat_demo_001",
"status": "draft",
"name": "Renewal reminders",
"agent_id": "agt_demo_001",
"total_recipients": 2,
"pending_recipients": 2,
"queued_recipients": 0,
"in_progress_recipients": 0,
"completed_recipients": 0,
"failed_recipients": 0,
"cancelled_recipients": 0,
"answered_recipients": 0,
"no_answer_recipients": 0,
"busy_recipients": 0,
"created_at": "2026-07-20T01:00:00Z",
"updated_at": "2026-07-20T01:00:00Z",
"scheduled_start_at": "2026-07-20T01:00:00Z",
"calling_window": {
"time_zone": "Asia/Taipei",
"weekdays": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday"
],
"start_time": "09:00",
"end_time": "18:00"
},
"started_at": "2026-07-20T01:00:00Z",
"paused_at": "2026-07-20T01:00:00Z",
"completed_at": "2026-07-20T01:00:00Z",
"cancelled_at": "2026-07-20T01:00:00Z",
"retry_of_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_root_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variables": {},
"metadata": {},
"reference_id": "<string>",
"external_id": "<string>",
"test_mode": true,
"structured_results": {},
"rendered_prompt": "<string>",
"rendered_first_sentence": "<string>",
"retry_pending_calls": 1,
"retry_attempts": 1
}批次撥號
建立批次草稿
建立包含 1 至 1,000 位不重複的既有聯絡人或內嵌收話人的草稿。只能提供其中一種收話人格式。必須提供 Idempotency-Key,且原始 JSON 主體上限為 1 MiB。每個回應都包含 Brightalk-Version 與 X-Request-Id;受到速率限制的回應還會提供實際套用之配額群組的計數器。
POST
/
batches
cURL
curl --request POST 'https://api.brightalk.ai/batches' \
--header "Authorization: Bearer $BRIGHTALK_API_KEY" \
--header "Brightalk-Version: 2026-07-16" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: createBatch-example-001" \
--data '{"name":"Renewal reminders","agent_id":"agt_demo_001","contact_ids":["con_demo_001","con_demo_002"]}'const response = await fetch("https://api.brightalk.ai/batches", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BRIGHTALK_API_KEY}`,
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createBatch-example-001",
},
body: JSON.stringify({"name":"Renewal reminders","agent_id":"agt_demo_001","contact_ids":["con_demo_001","con_demo_002"]}),
});
console.log(response.status, await response.json());import os
import requests
response = requests.request(
"POST",
"https://api.brightalk.ai/batches",
headers={
"Authorization": f"Bearer {os.environ['BRIGHTALK_API_KEY']}",
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createBatch-example-001",
},
json={"name":"Renewal reminders","agent_id":"agt_demo_001","contact_ids":["con_demo_001","con_demo_002"]},
)
print(response.status_code, response.json()){
"id": "bat_demo_001",
"status": "draft",
"name": "Renewal reminders",
"agent_id": "agt_demo_001",
"total_recipients": 2,
"pending_recipients": 2,
"queued_recipients": 0,
"in_progress_recipients": 0,
"completed_recipients": 0,
"failed_recipients": 0,
"cancelled_recipients": 0,
"answered_recipients": 0,
"no_answer_recipients": 0,
"busy_recipients": 0,
"created_at": "2026-07-20T01:00:00Z",
"updated_at": "2026-07-20T01:00:00Z",
"scheduled_start_at": "2026-07-20T01:00:00Z",
"calling_window": {
"time_zone": "Asia/Taipei",
"weekdays": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday"
],
"start_time": "09:00",
"end_time": "18:00"
},
"started_at": "2026-07-20T01:00:00Z",
"paused_at": "2026-07-20T01:00:00Z",
"completed_at": "2026-07-20T01:00:00Z",
"cancelled_at": "2026-07-20T01:00:00Z",
"retry_of_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_root_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variables": {},
"metadata": {},
"reference_id": "<string>",
"external_id": "<string>",
"test_mode": true,
"structured_results": {},
"rendered_prompt": "<string>",
"rendered_first_sentence": "<string>",
"retry_pending_calls": 1,
"retry_attempts": 1
}標頭
主體
application/json
JSON request body. The raw encoded body is limited to 1 MiB and unknown fields are rejected.
- Option 1
- Option 2
回應
已建立批次草稿。