cURL
curl --request POST 'https://api.brightalk.ai/calls' \
--header "Authorization: Bearer $BRIGHTALK_API_KEY" \
--header "Brightalk-Version: 2026-07-16" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: createCall-example-001" \
--data '{"agent_id":"agt_demo_001","contact_id":"con_demo_001"}'const response = await fetch("https://api.brightalk.ai/calls", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BRIGHTALK_API_KEY}`,
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createCall-example-001",
},
body: JSON.stringify({"agent_id":"agt_demo_001","contact_id":"con_demo_001"}),
});
console.log(response.status, await response.json());import os
import requests
response = requests.request(
"POST",
"https://api.brightalk.ai/calls",
headers={
"Authorization": f"Bearer {os.environ['BRIGHTALK_API_KEY']}",
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createCall-example-001",
},
json={"agent_id":"agt_demo_001","contact_id":"con_demo_001"},
)
print(response.status_code, response.json()){
"id": "11111111-1111-4111-8111-111111111111",
"status": "queued",
"answer_status": "answered",
"contact_id": "con_demo_001",
"agent_id": "agt_demo_001",
"queued_at": "2026-07-20T01:00:00Z",
"created_at": "2026-07-20T01:00:00Z",
"updated_at": "2026-07-20T01:00:00Z",
"batch_id": "bat_demo_001",
"automation_run_id": "run_demo_001",
"outcome": "qualified",
"outcome_reason": "Requested a follow-up.",
"summary": "Customer requested a follow-up next week.",
"duration_seconds": 92,
"dialing_at": "2026-07-20T01:00:00Z",
"connected_at": "2026-07-20T01:00:00Z",
"ended_at": "2026-07-20T01:00:00Z",
"cancel_requested_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>"
}Calls
將一通立即執行的 AI 通話加入佇列
以持久方式將一通 AI 通話排入佇列,使其可立即執行。容量限制可能使已接受的通話繼續留在佇列中。必須提供 Idempotency-Key,且原始 JSON 主體上限為 1 MiB。每個回應都包含 Brightalk-Version 與 X-Request-Id;受到速率限制的回應還會提供實際套用之配額群組的計數器。
POST
/
calls
cURL
curl --request POST 'https://api.brightalk.ai/calls' \
--header "Authorization: Bearer $BRIGHTALK_API_KEY" \
--header "Brightalk-Version: 2026-07-16" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: createCall-example-001" \
--data '{"agent_id":"agt_demo_001","contact_id":"con_demo_001"}'const response = await fetch("https://api.brightalk.ai/calls", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BRIGHTALK_API_KEY}`,
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createCall-example-001",
},
body: JSON.stringify({"agent_id":"agt_demo_001","contact_id":"con_demo_001"}),
});
console.log(response.status, await response.json());import os
import requests
response = requests.request(
"POST",
"https://api.brightalk.ai/calls",
headers={
"Authorization": f"Bearer {os.environ['BRIGHTALK_API_KEY']}",
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "createCall-example-001",
},
json={"agent_id":"agt_demo_001","contact_id":"con_demo_001"},
)
print(response.status_code, response.json()){
"id": "11111111-1111-4111-8111-111111111111",
"status": "queued",
"answer_status": "answered",
"contact_id": "con_demo_001",
"agent_id": "agt_demo_001",
"queued_at": "2026-07-20T01:00:00Z",
"created_at": "2026-07-20T01:00:00Z",
"updated_at": "2026-07-20T01:00:00Z",
"batch_id": "bat_demo_001",
"automation_run_id": "run_demo_001",
"outcome": "qualified",
"outcome_reason": "Requested a follow-up.",
"summary": "Customer requested a follow-up next week.",
"duration_seconds": 92,
"dialing_at": "2026-07-20T01:00:00Z",
"connected_at": "2026-07-20T01:00:00Z",
"ended_at": "2026-07-20T01:00:00Z",
"cancel_requested_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>"
}標頭
主體
application/json
JSON request body. The raw encoded body is limited to 1 MiB and unknown fields are rejected.
- Option 1
- Option 2
回應
通話已由持久佇列接受。