Create Campaign
curl --request POST \
--url https://app.agentika.site/api/v1/campaign/create \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow_id": 123,
"source_type": "<string>",
"source_id": "<string>",
"source_filename": "<string>",
"telephony_configuration_id": 123,
"retry_config": {
"enabled": true,
"max_retries": 50,
"retry_delay_seconds": 1815,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true,
"retry_on_voicemail_no_message": true,
"retry_on_screening_timeout": true,
"retry_on_screening_limit": true,
"retry_on_screening_message_missing": true,
"retry_on_ivr_detected": true,
"retry_on_ai_secretary": true,
"retry_on_machine_guard_timeout": true,
"retry_on_carrier_announcement": true,
"retry_on_hello_attempts_exhausted": true,
"retry_on_conversation_start_wait_expired": true
},
"max_concurrency": 50,
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"start_time": "<string>",
"end_time": "<string>"
}
],
"enabled": true,
"timezone": "<string>"
},
"circuit_breaker": {
"enabled": true,
"failure_threshold": 0.5,
"window_seconds": 120,
"min_calls_in_window": 5
},
"traffic_split": {
"targets": [
{
"workflow_id": 123,
"definition_id": 123,
"weight": 99
}
]
},
"answer_detection": {
"listening_window_ms": 5000,
"human_utterance_max_ms": 5000,
"machine_utterance_cap_ms": 30000,
"classify_budget_ms": 5000,
"screening_wait_ms": 30000,
"max_screening_rearms": 1,
"voicemail_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"screening_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"voicemail_message_template": "<string>"
},
"target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"caller_id_rotation": {
"mode": "off",
"daily_cap_per_number": 2,
"min_gap_seconds": 1,
"retry_number_policy": "new"
}
}
'import requests
url = "https://app.agentika.site/api/v1/campaign/create"
payload = {
"name": "<string>",
"workflow_id": 123,
"source_type": "<string>",
"source_id": "<string>",
"source_filename": "<string>",
"telephony_configuration_id": 123,
"retry_config": {
"enabled": True,
"max_retries": 50,
"retry_delay_seconds": 1815,
"retry_on_busy": True,
"retry_on_no_answer": True,
"retry_on_voicemail": True,
"retry_on_voicemail_no_message": True,
"retry_on_screening_timeout": True,
"retry_on_screening_limit": True,
"retry_on_screening_message_missing": True,
"retry_on_ivr_detected": True,
"retry_on_ai_secretary": True,
"retry_on_machine_guard_timeout": True,
"retry_on_carrier_announcement": True,
"retry_on_hello_attempts_exhausted": True,
"retry_on_conversation_start_wait_expired": True
},
"max_concurrency": 50,
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"start_time": "<string>",
"end_time": "<string>"
}
],
"enabled": True,
"timezone": "<string>"
},
"circuit_breaker": {
"enabled": True,
"failure_threshold": 0.5,
"window_seconds": 120,
"min_calls_in_window": 5
},
"traffic_split": { "targets": [
{
"workflow_id": 123,
"definition_id": 123,
"weight": 99
}
] },
"answer_detection": {
"listening_window_ms": 5000,
"human_utterance_max_ms": 5000,
"machine_utterance_cap_ms": 30000,
"classify_budget_ms": 5000,
"screening_wait_ms": 30000,
"max_screening_rearms": 1,
"voicemail_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"screening_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"voicemail_message_template": "<string>"
},
"target_actions": { "actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": ["<string>"]
}
] },
"caller_id_rotation": {
"mode": "off",
"daily_cap_per_number": 2,
"min_gap_seconds": 1,
"retry_number_policy": "new"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
workflow_id: 123,
source_type: '<string>',
source_id: '<string>',
source_filename: '<string>',
telephony_configuration_id: 123,
retry_config: {
enabled: true,
max_retries: 50,
retry_delay_seconds: 1815,
retry_on_busy: true,
retry_on_no_answer: true,
retry_on_voicemail: true,
retry_on_voicemail_no_message: true,
retry_on_screening_timeout: true,
retry_on_screening_limit: true,
retry_on_screening_message_missing: true,
retry_on_ivr_detected: true,
retry_on_ai_secretary: true,
retry_on_machine_guard_timeout: true,
retry_on_carrier_announcement: true,
retry_on_hello_attempts_exhausted: true,
retry_on_conversation_start_wait_expired: true
},
max_concurrency: 50,
schedule_config: {
slots: [{day_of_week: 3, start_time: '<string>', end_time: '<string>'}],
enabled: true,
timezone: '<string>'
},
circuit_breaker: {
enabled: true,
failure_threshold: 0.5,
window_seconds: 120,
min_calls_in_window: 5
},
traffic_split: {targets: [{workflow_id: 123, definition_id: 123, weight: 99}]},
answer_detection: {
listening_window_ms: 5000,
human_utterance_max_ms: 5000,
machine_utterance_cap_ms: 30000,
classify_budget_ms: 5000,
screening_wait_ms: 30000,
max_screening_rearms: 1,
voicemail_message: {text: '', recording_id: '<string>', recording_pk: 1},
screening_message: {text: '', recording_id: '<string>', recording_pk: 1},
voicemail_message_template: '<string>'
},
target_actions: {actions: [{id: '<string>', label: '<string>', function_names: ['<string>']}]},
caller_id_rotation: {
mode: 'off',
daily_cap_per_number: 2,
min_gap_seconds: 1,
retry_number_policy: 'new'
}
})
};
fetch('https://app.agentika.site/api/v1/campaign/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.agentika.site/api/v1/campaign/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'workflow_id' => 123,
'source_type' => '<string>',
'source_id' => '<string>',
'source_filename' => '<string>',
'telephony_configuration_id' => 123,
'retry_config' => [
'enabled' => true,
'max_retries' => 50,
'retry_delay_seconds' => 1815,
'retry_on_busy' => true,
'retry_on_no_answer' => true,
'retry_on_voicemail' => true,
'retry_on_voicemail_no_message' => true,
'retry_on_screening_timeout' => true,
'retry_on_screening_limit' => true,
'retry_on_screening_message_missing' => true,
'retry_on_ivr_detected' => true,
'retry_on_ai_secretary' => true,
'retry_on_machine_guard_timeout' => true,
'retry_on_carrier_announcement' => true,
'retry_on_hello_attempts_exhausted' => true,
'retry_on_conversation_start_wait_expired' => true
],
'max_concurrency' => 50,
'schedule_config' => [
'slots' => [
[
'day_of_week' => 3,
'start_time' => '<string>',
'end_time' => '<string>'
]
],
'enabled' => true,
'timezone' => '<string>'
],
'circuit_breaker' => [
'enabled' => true,
'failure_threshold' => 0.5,
'window_seconds' => 120,
'min_calls_in_window' => 5
],
'traffic_split' => [
'targets' => [
[
'workflow_id' => 123,
'definition_id' => 123,
'weight' => 99
]
]
],
'answer_detection' => [
'listening_window_ms' => 5000,
'human_utterance_max_ms' => 5000,
'machine_utterance_cap_ms' => 30000,
'classify_budget_ms' => 5000,
'screening_wait_ms' => 30000,
'max_screening_rearms' => 1,
'voicemail_message' => [
'text' => '',
'recording_id' => '<string>',
'recording_pk' => 1
],
'screening_message' => [
'text' => '',
'recording_id' => '<string>',
'recording_pk' => 1
],
'voicemail_message_template' => '<string>'
],
'target_actions' => [
'actions' => [
[
'id' => '<string>',
'label' => '<string>',
'function_names' => [
'<string>'
]
]
]
],
'caller_id_rotation' => [
'mode' => 'off',
'daily_cap_per_number' => 2,
'min_gap_seconds' => 1,
'retry_number_policy' => 'new'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.agentika.site/api/v1/campaign/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workflow_id\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_filename\": \"<string>\",\n \"telephony_configuration_id\": 123,\n \"retry_config\": {\n \"enabled\": true,\n \"max_retries\": 50,\n \"retry_delay_seconds\": 1815,\n \"retry_on_busy\": true,\n \"retry_on_no_answer\": true,\n \"retry_on_voicemail\": true,\n \"retry_on_voicemail_no_message\": true,\n \"retry_on_screening_timeout\": true,\n \"retry_on_screening_limit\": true,\n \"retry_on_screening_message_missing\": true,\n \"retry_on_ivr_detected\": true,\n \"retry_on_ai_secretary\": true,\n \"retry_on_machine_guard_timeout\": true,\n \"retry_on_carrier_announcement\": true,\n \"retry_on_hello_attempts_exhausted\": true,\n \"retry_on_conversation_start_wait_expired\": true\n },\n \"max_concurrency\": 50,\n \"schedule_config\": {\n \"slots\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"timezone\": \"<string>\"\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"failure_threshold\": 0.5,\n \"window_seconds\": 120,\n \"min_calls_in_window\": 5\n },\n \"traffic_split\": {\n \"targets\": [\n {\n \"workflow_id\": 123,\n \"definition_id\": 123,\n \"weight\": 99\n }\n ]\n },\n \"answer_detection\": {\n \"listening_window_ms\": 5000,\n \"human_utterance_max_ms\": 5000,\n \"machine_utterance_cap_ms\": 30000,\n \"classify_budget_ms\": 5000,\n \"screening_wait_ms\": 30000,\n \"max_screening_rearms\": 1,\n \"voicemail_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"screening_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"voicemail_message_template\": \"<string>\"\n },\n \"target_actions\": {\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"function_names\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"caller_id_rotation\": {\n \"mode\": \"off\",\n \"daily_cap_per_number\": 2,\n \"min_gap_seconds\": 1,\n \"retry_number_policy\": \"new\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentika.site/api/v1/campaign/create")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workflow_id\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_filename\": \"<string>\",\n \"telephony_configuration_id\": 123,\n \"retry_config\": {\n \"enabled\": true,\n \"max_retries\": 50,\n \"retry_delay_seconds\": 1815,\n \"retry_on_busy\": true,\n \"retry_on_no_answer\": true,\n \"retry_on_voicemail\": true,\n \"retry_on_voicemail_no_message\": true,\n \"retry_on_screening_timeout\": true,\n \"retry_on_screening_limit\": true,\n \"retry_on_screening_message_missing\": true,\n \"retry_on_ivr_detected\": true,\n \"retry_on_ai_secretary\": true,\n \"retry_on_machine_guard_timeout\": true,\n \"retry_on_carrier_announcement\": true,\n \"retry_on_hello_attempts_exhausted\": true,\n \"retry_on_conversation_start_wait_expired\": true\n },\n \"max_concurrency\": 50,\n \"schedule_config\": {\n \"slots\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"timezone\": \"<string>\"\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"failure_threshold\": 0.5,\n \"window_seconds\": 120,\n \"min_calls_in_window\": 5\n },\n \"traffic_split\": {\n \"targets\": [\n {\n \"workflow_id\": 123,\n \"definition_id\": 123,\n \"weight\": 99\n }\n ]\n },\n \"answer_detection\": {\n \"listening_window_ms\": 5000,\n \"human_utterance_max_ms\": 5000,\n \"machine_utterance_cap_ms\": 30000,\n \"classify_budget_ms\": 5000,\n \"screening_wait_ms\": 30000,\n \"max_screening_rearms\": 1,\n \"voicemail_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"screening_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"voicemail_message_template\": \"<string>\"\n },\n \"target_actions\": {\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"function_names\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"caller_id_rotation\": {\n \"mode\": \"off\",\n \"daily_cap_per_number\": 2,\n \"min_gap_seconds\": 1,\n \"retry_number_policy\": \"new\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentika.site/api/v1/campaign/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"workflow_id\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_filename\": \"<string>\",\n \"telephony_configuration_id\": 123,\n \"retry_config\": {\n \"enabled\": true,\n \"max_retries\": 50,\n \"retry_delay_seconds\": 1815,\n \"retry_on_busy\": true,\n \"retry_on_no_answer\": true,\n \"retry_on_voicemail\": true,\n \"retry_on_voicemail_no_message\": true,\n \"retry_on_screening_timeout\": true,\n \"retry_on_screening_limit\": true,\n \"retry_on_screening_message_missing\": true,\n \"retry_on_ivr_detected\": true,\n \"retry_on_ai_secretary\": true,\n \"retry_on_machine_guard_timeout\": true,\n \"retry_on_carrier_announcement\": true,\n \"retry_on_hello_attempts_exhausted\": true,\n \"retry_on_conversation_start_wait_expired\": true\n },\n \"max_concurrency\": 50,\n \"schedule_config\": {\n \"slots\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"timezone\": \"<string>\"\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"failure_threshold\": 0.5,\n \"window_seconds\": 120,\n \"min_calls_in_window\": 5\n },\n \"traffic_split\": {\n \"targets\": [\n {\n \"workflow_id\": 123,\n \"definition_id\": 123,\n \"weight\": 99\n }\n ]\n },\n \"answer_detection\": {\n \"listening_window_ms\": 5000,\n \"human_utterance_max_ms\": 5000,\n \"machine_utterance_cap_ms\": 30000,\n \"classify_budget_ms\": 5000,\n \"screening_wait_ms\": 30000,\n \"max_screening_rearms\": 1,\n \"voicemail_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"screening_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"voicemail_message_template\": \"<string>\"\n },\n \"target_actions\": {\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"function_names\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"caller_id_rotation\": {\n \"mode\": \"off\",\n \"daily_cap_per_number\": 2,\n \"min_gap_seconds\": 1,\n \"retry_number_policy\": \"new\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"workflow_id": 123,
"workflow_name": "<string>",
"state": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"total_rows": 123,
"processed_rows": 123,
"failed_rows": 123,
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"retry_config": {
"enabled": true,
"max_retries": 123,
"retry_delay_seconds": 123,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true,
"retry_on_voicemail_no_message": false,
"retry_on_screening_timeout": false,
"retry_on_screening_limit": false,
"retry_on_screening_message_missing": false,
"retry_on_ivr_detected": false,
"retry_on_ai_secretary": false,
"retry_on_machine_guard_timeout": false,
"retry_on_carrier_announcement": false,
"retry_on_hello_attempts_exhausted": true,
"retry_on_conversation_start_wait_expired": true
},
"traffic_split": {
"targets": [
{
"workflow_id": 123,
"definition_id": 123,
"weight": 99
}
]
},
"answer_detection": {
"preset": "careful",
"listening_window_ms": 5000,
"human_utterance_max_ms": 5000,
"machine_utterance_cap_ms": 30000,
"classify_budget_ms": 5000,
"screening_wait_ms": 30000,
"max_screening_rearms": 1,
"voicemail_action": "hangup",
"voicemail_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"screening_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"voicemail_message_template": "<string>"
},
"target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"effective_target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"caller_id_rotation": {
"mode": "off",
"daily_cap_per_number": 123,
"min_gap_seconds": 123,
"retry_number_policy": "new",
"daily_cap_ceiling": 123,
"effective_daily_cap_per_number": 123,
"min_gap_ceiling_seconds": 123,
"effective_min_gap_seconds": 123,
"number_chosen_by_operator": false,
"unavailable_reason": "<string>"
},
"pause_pending": false,
"source_filename": "<string>",
"max_concurrency": 123,
"schedule_config": {
"enabled": true,
"timezone": "<string>",
"slots": [
{
"day_of_week": 123,
"start_time": "<string>",
"end_time": "<string>"
}
]
},
"circuit_breaker": {
"enabled": false,
"failure_threshold": 0.5,
"window_seconds": 120,
"min_calls_in_window": 5
},
"executed_count": 0,
"total_queued_count": 0,
"parent_campaign_id": 123,
"redialed_campaign_id": 123,
"telephony_configuration_id": 123,
"telephony_configuration_name": "<string>",
"logs": [
{
"ts": "<string>",
"level": "<string>",
"event": "<string>",
"message": "<string>",
"details": {}
}
],
"pause_reason": "<string>",
"overview": {
"outcomes": {
"connected": 0,
"no_answer": 0,
"busy": 0,
"other": 0
},
"hourly": [
{
"hour": 11,
"connected": 0,
"other": 0
}
],
"progress": {
"total_contacts": 0,
"processed": 0,
"queued_remaining": 0
},
"dialing": {
"can_dial": true,
"reason": "not_started",
"next_window_start": "2023-11-07T05:31:56Z",
"resume_at": "2023-11-07T05:31:56Z"
},
"goals": [
{
"action_id": "<string>",
"label": "<string>",
"runs": 123,
"calls": 123,
"rate": 123
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Кампании
Создать кампанию
Создайте кампанию по загруженному списку контактов, затем запустите её отдельно.
POST
/
api
/
v1
/
campaign
/
create
Create Campaign
curl --request POST \
--url https://app.agentika.site/api/v1/campaign/create \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workflow_id": 123,
"source_type": "<string>",
"source_id": "<string>",
"source_filename": "<string>",
"telephony_configuration_id": 123,
"retry_config": {
"enabled": true,
"max_retries": 50,
"retry_delay_seconds": 1815,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true,
"retry_on_voicemail_no_message": true,
"retry_on_screening_timeout": true,
"retry_on_screening_limit": true,
"retry_on_screening_message_missing": true,
"retry_on_ivr_detected": true,
"retry_on_ai_secretary": true,
"retry_on_machine_guard_timeout": true,
"retry_on_carrier_announcement": true,
"retry_on_hello_attempts_exhausted": true,
"retry_on_conversation_start_wait_expired": true
},
"max_concurrency": 50,
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"start_time": "<string>",
"end_time": "<string>"
}
],
"enabled": true,
"timezone": "<string>"
},
"circuit_breaker": {
"enabled": true,
"failure_threshold": 0.5,
"window_seconds": 120,
"min_calls_in_window": 5
},
"traffic_split": {
"targets": [
{
"workflow_id": 123,
"definition_id": 123,
"weight": 99
}
]
},
"answer_detection": {
"listening_window_ms": 5000,
"human_utterance_max_ms": 5000,
"machine_utterance_cap_ms": 30000,
"classify_budget_ms": 5000,
"screening_wait_ms": 30000,
"max_screening_rearms": 1,
"voicemail_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"screening_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"voicemail_message_template": "<string>"
},
"target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"caller_id_rotation": {
"mode": "off",
"daily_cap_per_number": 2,
"min_gap_seconds": 1,
"retry_number_policy": "new"
}
}
'import requests
url = "https://app.agentika.site/api/v1/campaign/create"
payload = {
"name": "<string>",
"workflow_id": 123,
"source_type": "<string>",
"source_id": "<string>",
"source_filename": "<string>",
"telephony_configuration_id": 123,
"retry_config": {
"enabled": True,
"max_retries": 50,
"retry_delay_seconds": 1815,
"retry_on_busy": True,
"retry_on_no_answer": True,
"retry_on_voicemail": True,
"retry_on_voicemail_no_message": True,
"retry_on_screening_timeout": True,
"retry_on_screening_limit": True,
"retry_on_screening_message_missing": True,
"retry_on_ivr_detected": True,
"retry_on_ai_secretary": True,
"retry_on_machine_guard_timeout": True,
"retry_on_carrier_announcement": True,
"retry_on_hello_attempts_exhausted": True,
"retry_on_conversation_start_wait_expired": True
},
"max_concurrency": 50,
"schedule_config": {
"slots": [
{
"day_of_week": 3,
"start_time": "<string>",
"end_time": "<string>"
}
],
"enabled": True,
"timezone": "<string>"
},
"circuit_breaker": {
"enabled": True,
"failure_threshold": 0.5,
"window_seconds": 120,
"min_calls_in_window": 5
},
"traffic_split": { "targets": [
{
"workflow_id": 123,
"definition_id": 123,
"weight": 99
}
] },
"answer_detection": {
"listening_window_ms": 5000,
"human_utterance_max_ms": 5000,
"machine_utterance_cap_ms": 30000,
"classify_budget_ms": 5000,
"screening_wait_ms": 30000,
"max_screening_rearms": 1,
"voicemail_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"screening_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"voicemail_message_template": "<string>"
},
"target_actions": { "actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": ["<string>"]
}
] },
"caller_id_rotation": {
"mode": "off",
"daily_cap_per_number": 2,
"min_gap_seconds": 1,
"retry_number_policy": "new"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
workflow_id: 123,
source_type: '<string>',
source_id: '<string>',
source_filename: '<string>',
telephony_configuration_id: 123,
retry_config: {
enabled: true,
max_retries: 50,
retry_delay_seconds: 1815,
retry_on_busy: true,
retry_on_no_answer: true,
retry_on_voicemail: true,
retry_on_voicemail_no_message: true,
retry_on_screening_timeout: true,
retry_on_screening_limit: true,
retry_on_screening_message_missing: true,
retry_on_ivr_detected: true,
retry_on_ai_secretary: true,
retry_on_machine_guard_timeout: true,
retry_on_carrier_announcement: true,
retry_on_hello_attempts_exhausted: true,
retry_on_conversation_start_wait_expired: true
},
max_concurrency: 50,
schedule_config: {
slots: [{day_of_week: 3, start_time: '<string>', end_time: '<string>'}],
enabled: true,
timezone: '<string>'
},
circuit_breaker: {
enabled: true,
failure_threshold: 0.5,
window_seconds: 120,
min_calls_in_window: 5
},
traffic_split: {targets: [{workflow_id: 123, definition_id: 123, weight: 99}]},
answer_detection: {
listening_window_ms: 5000,
human_utterance_max_ms: 5000,
machine_utterance_cap_ms: 30000,
classify_budget_ms: 5000,
screening_wait_ms: 30000,
max_screening_rearms: 1,
voicemail_message: {text: '', recording_id: '<string>', recording_pk: 1},
screening_message: {text: '', recording_id: '<string>', recording_pk: 1},
voicemail_message_template: '<string>'
},
target_actions: {actions: [{id: '<string>', label: '<string>', function_names: ['<string>']}]},
caller_id_rotation: {
mode: 'off',
daily_cap_per_number: 2,
min_gap_seconds: 1,
retry_number_policy: 'new'
}
})
};
fetch('https://app.agentika.site/api/v1/campaign/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.agentika.site/api/v1/campaign/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'workflow_id' => 123,
'source_type' => '<string>',
'source_id' => '<string>',
'source_filename' => '<string>',
'telephony_configuration_id' => 123,
'retry_config' => [
'enabled' => true,
'max_retries' => 50,
'retry_delay_seconds' => 1815,
'retry_on_busy' => true,
'retry_on_no_answer' => true,
'retry_on_voicemail' => true,
'retry_on_voicemail_no_message' => true,
'retry_on_screening_timeout' => true,
'retry_on_screening_limit' => true,
'retry_on_screening_message_missing' => true,
'retry_on_ivr_detected' => true,
'retry_on_ai_secretary' => true,
'retry_on_machine_guard_timeout' => true,
'retry_on_carrier_announcement' => true,
'retry_on_hello_attempts_exhausted' => true,
'retry_on_conversation_start_wait_expired' => true
],
'max_concurrency' => 50,
'schedule_config' => [
'slots' => [
[
'day_of_week' => 3,
'start_time' => '<string>',
'end_time' => '<string>'
]
],
'enabled' => true,
'timezone' => '<string>'
],
'circuit_breaker' => [
'enabled' => true,
'failure_threshold' => 0.5,
'window_seconds' => 120,
'min_calls_in_window' => 5
],
'traffic_split' => [
'targets' => [
[
'workflow_id' => 123,
'definition_id' => 123,
'weight' => 99
]
]
],
'answer_detection' => [
'listening_window_ms' => 5000,
'human_utterance_max_ms' => 5000,
'machine_utterance_cap_ms' => 30000,
'classify_budget_ms' => 5000,
'screening_wait_ms' => 30000,
'max_screening_rearms' => 1,
'voicemail_message' => [
'text' => '',
'recording_id' => '<string>',
'recording_pk' => 1
],
'screening_message' => [
'text' => '',
'recording_id' => '<string>',
'recording_pk' => 1
],
'voicemail_message_template' => '<string>'
],
'target_actions' => [
'actions' => [
[
'id' => '<string>',
'label' => '<string>',
'function_names' => [
'<string>'
]
]
]
],
'caller_id_rotation' => [
'mode' => 'off',
'daily_cap_per_number' => 2,
'min_gap_seconds' => 1,
'retry_number_policy' => 'new'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.agentika.site/api/v1/campaign/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workflow_id\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_filename\": \"<string>\",\n \"telephony_configuration_id\": 123,\n \"retry_config\": {\n \"enabled\": true,\n \"max_retries\": 50,\n \"retry_delay_seconds\": 1815,\n \"retry_on_busy\": true,\n \"retry_on_no_answer\": true,\n \"retry_on_voicemail\": true,\n \"retry_on_voicemail_no_message\": true,\n \"retry_on_screening_timeout\": true,\n \"retry_on_screening_limit\": true,\n \"retry_on_screening_message_missing\": true,\n \"retry_on_ivr_detected\": true,\n \"retry_on_ai_secretary\": true,\n \"retry_on_machine_guard_timeout\": true,\n \"retry_on_carrier_announcement\": true,\n \"retry_on_hello_attempts_exhausted\": true,\n \"retry_on_conversation_start_wait_expired\": true\n },\n \"max_concurrency\": 50,\n \"schedule_config\": {\n \"slots\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"timezone\": \"<string>\"\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"failure_threshold\": 0.5,\n \"window_seconds\": 120,\n \"min_calls_in_window\": 5\n },\n \"traffic_split\": {\n \"targets\": [\n {\n \"workflow_id\": 123,\n \"definition_id\": 123,\n \"weight\": 99\n }\n ]\n },\n \"answer_detection\": {\n \"listening_window_ms\": 5000,\n \"human_utterance_max_ms\": 5000,\n \"machine_utterance_cap_ms\": 30000,\n \"classify_budget_ms\": 5000,\n \"screening_wait_ms\": 30000,\n \"max_screening_rearms\": 1,\n \"voicemail_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"screening_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"voicemail_message_template\": \"<string>\"\n },\n \"target_actions\": {\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"function_names\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"caller_id_rotation\": {\n \"mode\": \"off\",\n \"daily_cap_per_number\": 2,\n \"min_gap_seconds\": 1,\n \"retry_number_policy\": \"new\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.agentika.site/api/v1/campaign/create")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workflow_id\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_filename\": \"<string>\",\n \"telephony_configuration_id\": 123,\n \"retry_config\": {\n \"enabled\": true,\n \"max_retries\": 50,\n \"retry_delay_seconds\": 1815,\n \"retry_on_busy\": true,\n \"retry_on_no_answer\": true,\n \"retry_on_voicemail\": true,\n \"retry_on_voicemail_no_message\": true,\n \"retry_on_screening_timeout\": true,\n \"retry_on_screening_limit\": true,\n \"retry_on_screening_message_missing\": true,\n \"retry_on_ivr_detected\": true,\n \"retry_on_ai_secretary\": true,\n \"retry_on_machine_guard_timeout\": true,\n \"retry_on_carrier_announcement\": true,\n \"retry_on_hello_attempts_exhausted\": true,\n \"retry_on_conversation_start_wait_expired\": true\n },\n \"max_concurrency\": 50,\n \"schedule_config\": {\n \"slots\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"timezone\": \"<string>\"\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"failure_threshold\": 0.5,\n \"window_seconds\": 120,\n \"min_calls_in_window\": 5\n },\n \"traffic_split\": {\n \"targets\": [\n {\n \"workflow_id\": 123,\n \"definition_id\": 123,\n \"weight\": 99\n }\n ]\n },\n \"answer_detection\": {\n \"listening_window_ms\": 5000,\n \"human_utterance_max_ms\": 5000,\n \"machine_utterance_cap_ms\": 30000,\n \"classify_budget_ms\": 5000,\n \"screening_wait_ms\": 30000,\n \"max_screening_rearms\": 1,\n \"voicemail_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"screening_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"voicemail_message_template\": \"<string>\"\n },\n \"target_actions\": {\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"function_names\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"caller_id_rotation\": {\n \"mode\": \"off\",\n \"daily_cap_per_number\": 2,\n \"min_gap_seconds\": 1,\n \"retry_number_policy\": \"new\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.agentika.site/api/v1/campaign/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"workflow_id\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_filename\": \"<string>\",\n \"telephony_configuration_id\": 123,\n \"retry_config\": {\n \"enabled\": true,\n \"max_retries\": 50,\n \"retry_delay_seconds\": 1815,\n \"retry_on_busy\": true,\n \"retry_on_no_answer\": true,\n \"retry_on_voicemail\": true,\n \"retry_on_voicemail_no_message\": true,\n \"retry_on_screening_timeout\": true,\n \"retry_on_screening_limit\": true,\n \"retry_on_screening_message_missing\": true,\n \"retry_on_ivr_detected\": true,\n \"retry_on_ai_secretary\": true,\n \"retry_on_machine_guard_timeout\": true,\n \"retry_on_carrier_announcement\": true,\n \"retry_on_hello_attempts_exhausted\": true,\n \"retry_on_conversation_start_wait_expired\": true\n },\n \"max_concurrency\": 50,\n \"schedule_config\": {\n \"slots\": [\n {\n \"day_of_week\": 3,\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"timezone\": \"<string>\"\n },\n \"circuit_breaker\": {\n \"enabled\": true,\n \"failure_threshold\": 0.5,\n \"window_seconds\": 120,\n \"min_calls_in_window\": 5\n },\n \"traffic_split\": {\n \"targets\": [\n {\n \"workflow_id\": 123,\n \"definition_id\": 123,\n \"weight\": 99\n }\n ]\n },\n \"answer_detection\": {\n \"listening_window_ms\": 5000,\n \"human_utterance_max_ms\": 5000,\n \"machine_utterance_cap_ms\": 30000,\n \"classify_budget_ms\": 5000,\n \"screening_wait_ms\": 30000,\n \"max_screening_rearms\": 1,\n \"voicemail_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"screening_message\": {\n \"text\": \"\",\n \"recording_id\": \"<string>\",\n \"recording_pk\": 1\n },\n \"voicemail_message_template\": \"<string>\"\n },\n \"target_actions\": {\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"function_names\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"caller_id_rotation\": {\n \"mode\": \"off\",\n \"daily_cap_per_number\": 2,\n \"min_gap_seconds\": 1,\n \"retry_number_policy\": \"new\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"workflow_id": 123,
"workflow_name": "<string>",
"state": "<string>",
"source_type": "<string>",
"source_id": "<string>",
"total_rows": 123,
"processed_rows": 123,
"failed_rows": 123,
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"retry_config": {
"enabled": true,
"max_retries": 123,
"retry_delay_seconds": 123,
"retry_on_busy": true,
"retry_on_no_answer": true,
"retry_on_voicemail": true,
"retry_on_voicemail_no_message": false,
"retry_on_screening_timeout": false,
"retry_on_screening_limit": false,
"retry_on_screening_message_missing": false,
"retry_on_ivr_detected": false,
"retry_on_ai_secretary": false,
"retry_on_machine_guard_timeout": false,
"retry_on_carrier_announcement": false,
"retry_on_hello_attempts_exhausted": true,
"retry_on_conversation_start_wait_expired": true
},
"traffic_split": {
"targets": [
{
"workflow_id": 123,
"definition_id": 123,
"weight": 99
}
]
},
"answer_detection": {
"preset": "careful",
"listening_window_ms": 5000,
"human_utterance_max_ms": 5000,
"machine_utterance_cap_ms": 30000,
"classify_budget_ms": 5000,
"screening_wait_ms": 30000,
"max_screening_rearms": 1,
"voicemail_action": "hangup",
"voicemail_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"screening_message": {
"text": "",
"recording_id": "<string>",
"recording_pk": 1
},
"voicemail_message_template": "<string>"
},
"target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"effective_target_actions": {
"actions": [
{
"id": "<string>",
"label": "<string>",
"function_names": [
"<string>"
]
}
]
},
"caller_id_rotation": {
"mode": "off",
"daily_cap_per_number": 123,
"min_gap_seconds": 123,
"retry_number_policy": "new",
"daily_cap_ceiling": 123,
"effective_daily_cap_per_number": 123,
"min_gap_ceiling_seconds": 123,
"effective_min_gap_seconds": 123,
"number_chosen_by_operator": false,
"unavailable_reason": "<string>"
},
"pause_pending": false,
"source_filename": "<string>",
"max_concurrency": 123,
"schedule_config": {
"enabled": true,
"timezone": "<string>",
"slots": [
{
"day_of_week": 123,
"start_time": "<string>",
"end_time": "<string>"
}
]
},
"circuit_breaker": {
"enabled": false,
"failure_threshold": 0.5,
"window_seconds": 120,
"min_calls_in_window": 5
},
"executed_count": 0,
"total_queued_count": 0,
"parent_campaign_id": 123,
"redialed_campaign_id": 123,
"telephony_configuration_id": 123,
"telephony_configuration_name": "<string>",
"logs": [
{
"ts": "<string>",
"level": "<string>",
"event": "<string>",
"message": "<string>",
"details": {}
}
],
"pause_reason": "<string>",
"overview": {
"outcomes": {
"connected": 0,
"no_answer": 0,
"busy": 0,
"other": 0
},
"hourly": [
{
"hour": 11,
"connected": 0,
"other": 0
}
],
"progress": {
"total_contacts": 0,
"processed": 0,
"queued_remaining": 0
},
"dialing": {
"can_dial": true,
"reason": "not_started",
"next_window_start": "2023-11-07T05:31:56Z",
"resume_at": "2023-11-07T05:31:56Z"
},
"goals": [
{
"action_id": "<string>",
"label": "<string>",
"runs": 123,
"calls": 123,
"rate": 123
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Сначала загрузите CSV с контактами. Полученный
file_key передайте как source_id; source_type должен быть csv.
Необязательное поле source_filename (до 255 символов) сохраняет исходное имя файла: по нему скачивается CSV со страницы кампании и через source-download-url. Если не передано, имя восстанавливается из ключа файла.
Выберите workflow_id и при необходимости telephony_configuration_id — подключение для исходящих звонков. Если подключение не задано явно, используется исходящее по умолчанию для организации. Кампанию можно создать и сохранить без телефонии, но запуск, возобновление и перезапуск вернут 409 с кодом CAMPAIGN_TELEPHONY_NOT_CONFIGURED, пока в организации не настроена телефония.
Если промпт выбранной опубликованной версии агента использует переменную шаблона,
её значение должно быть непустым в каждой строке CSV либо задано в самой
опубликованной версии, когда столбца CSV нет. При traffic_split проверяются
все выбранные версии. Подробнее — CSV с контактами.
Расписание
Настройки расписания передаются внутриschedule_config: enabled, timezone и slots. timezone необязателен: если он не указан, при создании берётся часовой пояс аккаунта, а при изменении сохраняется текущий часовой пояс кампании. Каждый интервал содержит day_of_week — число от 0 до 6, start_time и end_time в формате HH:MM. Полную структуру и допустимые значения смотрите в схеме запроса на этой странице.
После создания кампания ещё не звонит. Проверьте её настройки и вызовите операцию запуска.
Для настройки без программирования используйте руководство по кампаниям.
Необязательный объект caller_id_rotation включает смену номера между звонками. Без него кампания звонит как раньше. Значения выше потолков платформы отклоняются.Body
application/json
Sparse overlay: every field is tri-state. None (omitted or an
explicit null) means "not sent" — at create the platform
campaign.retry_default.* values apply (resolve_retry_config), on
PATCH the campaign's stored value is kept (a stored false flag is
never reset to a default).
Show child attributes
Show child attributes
Response
Successful Response