Създаване на кампания
curl --request POST \
--url https://call.aiployees.com/api/user/campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"assistant_id": 123,
"timezone": "<string>",
"max_calls_in_parallel": 123,
"allowed_hours_start_time": "<string>",
"allowed_hours_end_time": "<string>",
"allowed_days": [
{}
],
"max_retries": 123,
"retry_interval": 123,
"retry_on_voicemail": true,
"retry_on_goal_incomplete": true,
"goal_completion_variable": "<string>",
"mark_complete_when_no_leads": true,
"phone_number_ids": [
{}
]
}
'import requests
url = "https://call.aiployees.com/api/user/campaign"
payload = {
"name": "<string>",
"assistant_id": 123,
"timezone": "<string>",
"max_calls_in_parallel": 123,
"allowed_hours_start_time": "<string>",
"allowed_hours_end_time": "<string>",
"allowed_days": [{}],
"max_retries": 123,
"retry_interval": 123,
"retry_on_voicemail": True,
"retry_on_goal_incomplete": True,
"goal_completion_variable": "<string>",
"mark_complete_when_no_leads": True,
"phone_number_ids": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
assistant_id: 123,
timezone: '<string>',
max_calls_in_parallel: 123,
allowed_hours_start_time: '<string>',
allowed_hours_end_time: '<string>',
allowed_days: [{}],
max_retries: 123,
retry_interval: 123,
retry_on_voicemail: true,
retry_on_goal_incomplete: true,
goal_completion_variable: '<string>',
mark_complete_when_no_leads: true,
phone_number_ids: [{}]
})
};
fetch('https://call.aiployees.com/api/user/campaign', 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://call.aiployees.com/api/user/campaign",
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>',
'assistant_id' => 123,
'timezone' => '<string>',
'max_calls_in_parallel' => 123,
'allowed_hours_start_time' => '<string>',
'allowed_hours_end_time' => '<string>',
'allowed_days' => [
[
]
],
'max_retries' => 123,
'retry_interval' => 123,
'retry_on_voicemail' => true,
'retry_on_goal_incomplete' => true,
'goal_completion_variable' => '<string>',
'mark_complete_when_no_leads' => true,
'phone_number_ids' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://call.aiployees.com/api/user/campaign"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"assistant_id\": 123,\n \"timezone\": \"<string>\",\n \"max_calls_in_parallel\": 123,\n \"allowed_hours_start_time\": \"<string>\",\n \"allowed_hours_end_time\": \"<string>\",\n \"allowed_days\": [\n {}\n ],\n \"max_retries\": 123,\n \"retry_interval\": 123,\n \"retry_on_voicemail\": true,\n \"retry_on_goal_incomplete\": true,\n \"goal_completion_variable\": \"<string>\",\n \"mark_complete_when_no_leads\": true,\n \"phone_number_ids\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://call.aiployees.com/api/user/campaign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"assistant_id\": 123,\n \"timezone\": \"<string>\",\n \"max_calls_in_parallel\": 123,\n \"allowed_hours_start_time\": \"<string>\",\n \"allowed_hours_end_time\": \"<string>\",\n \"allowed_days\": [\n {}\n ],\n \"max_retries\": 123,\n \"retry_interval\": 123,\n \"retry_on_voicemail\": true,\n \"retry_on_goal_incomplete\": true,\n \"goal_completion_variable\": \"<string>\",\n \"mark_complete_when_no_leads\": true,\n \"phone_number_ids\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"assistant_id\": 123,\n \"timezone\": \"<string>\",\n \"max_calls_in_parallel\": 123,\n \"allowed_hours_start_time\": \"<string>\",\n \"allowed_hours_end_time\": \"<string>\",\n \"allowed_days\": [\n {}\n ],\n \"max_retries\": 123,\n \"retry_interval\": 123,\n \"retry_on_voicemail\": true,\n \"retry_on_goal_incomplete\": true,\n \"goal_completion_variable\": \"<string>\",\n \"mark_complete_when_no_leads\": true,\n \"phone_number_ids\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Campaign created successfully",
"data": {
"id": 1,
"name": "Product Demo Campaign",
"status": "draft",
"max_calls_in_parallel": 3,
"mark_complete_when_no_leads": true,
"allowed_hours_start_time": "09:00:00",
"allowed_hours_end_time": "17:00:00",
"allowed_days": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday"
],
"max_retries": 3,
"retry_interval": 60,
"created_at": "2026-02-23T10:00:00.000000Z",
"updated_at": "2026-02-23T10:00:00.000000Z"
}
}
{
"message": "You have reached the maximum number of campaigns allowed by your plan."
}
{
"message": "Assistant not found or not an outbound assistant."
}
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"assistant_id": [
"The assistant id field is required."
]
}
}
Кампании
Създаване на кампания
Създаване на нова кампания за изходящи обаждания
POST
/
user
/
campaign
Създаване на кампания
curl --request POST \
--url https://call.aiployees.com/api/user/campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"assistant_id": 123,
"timezone": "<string>",
"max_calls_in_parallel": 123,
"allowed_hours_start_time": "<string>",
"allowed_hours_end_time": "<string>",
"allowed_days": [
{}
],
"max_retries": 123,
"retry_interval": 123,
"retry_on_voicemail": true,
"retry_on_goal_incomplete": true,
"goal_completion_variable": "<string>",
"mark_complete_when_no_leads": true,
"phone_number_ids": [
{}
]
}
'import requests
url = "https://call.aiployees.com/api/user/campaign"
payload = {
"name": "<string>",
"assistant_id": 123,
"timezone": "<string>",
"max_calls_in_parallel": 123,
"allowed_hours_start_time": "<string>",
"allowed_hours_end_time": "<string>",
"allowed_days": [{}],
"max_retries": 123,
"retry_interval": 123,
"retry_on_voicemail": True,
"retry_on_goal_incomplete": True,
"goal_completion_variable": "<string>",
"mark_complete_when_no_leads": True,
"phone_number_ids": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
assistant_id: 123,
timezone: '<string>',
max_calls_in_parallel: 123,
allowed_hours_start_time: '<string>',
allowed_hours_end_time: '<string>',
allowed_days: [{}],
max_retries: 123,
retry_interval: 123,
retry_on_voicemail: true,
retry_on_goal_incomplete: true,
goal_completion_variable: '<string>',
mark_complete_when_no_leads: true,
phone_number_ids: [{}]
})
};
fetch('https://call.aiployees.com/api/user/campaign', 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://call.aiployees.com/api/user/campaign",
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>',
'assistant_id' => 123,
'timezone' => '<string>',
'max_calls_in_parallel' => 123,
'allowed_hours_start_time' => '<string>',
'allowed_hours_end_time' => '<string>',
'allowed_days' => [
[
]
],
'max_retries' => 123,
'retry_interval' => 123,
'retry_on_voicemail' => true,
'retry_on_goal_incomplete' => true,
'goal_completion_variable' => '<string>',
'mark_complete_when_no_leads' => true,
'phone_number_ids' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://call.aiployees.com/api/user/campaign"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"assistant_id\": 123,\n \"timezone\": \"<string>\",\n \"max_calls_in_parallel\": 123,\n \"allowed_hours_start_time\": \"<string>\",\n \"allowed_hours_end_time\": \"<string>\",\n \"allowed_days\": [\n {}\n ],\n \"max_retries\": 123,\n \"retry_interval\": 123,\n \"retry_on_voicemail\": true,\n \"retry_on_goal_incomplete\": true,\n \"goal_completion_variable\": \"<string>\",\n \"mark_complete_when_no_leads\": true,\n \"phone_number_ids\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://call.aiployees.com/api/user/campaign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"assistant_id\": 123,\n \"timezone\": \"<string>\",\n \"max_calls_in_parallel\": 123,\n \"allowed_hours_start_time\": \"<string>\",\n \"allowed_hours_end_time\": \"<string>\",\n \"allowed_days\": [\n {}\n ],\n \"max_retries\": 123,\n \"retry_interval\": 123,\n \"retry_on_voicemail\": true,\n \"retry_on_goal_incomplete\": true,\n \"goal_completion_variable\": \"<string>\",\n \"mark_complete_when_no_leads\": true,\n \"phone_number_ids\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://call.aiployees.com/api/user/campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"assistant_id\": 123,\n \"timezone\": \"<string>\",\n \"max_calls_in_parallel\": 123,\n \"allowed_hours_start_time\": \"<string>\",\n \"allowed_hours_end_time\": \"<string>\",\n \"allowed_days\": [\n {}\n ],\n \"max_retries\": 123,\n \"retry_interval\": 123,\n \"retry_on_voicemail\": true,\n \"retry_on_goal_incomplete\": true,\n \"goal_completion_variable\": \"<string>\",\n \"mark_complete_when_no_leads\": true,\n \"phone_number_ids\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Campaign created successfully",
"data": {
"id": 1,
"name": "Product Demo Campaign",
"status": "draft",
"max_calls_in_parallel": 3,
"mark_complete_when_no_leads": true,
"allowed_hours_start_time": "09:00:00",
"allowed_hours_end_time": "17:00:00",
"allowed_days": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday"
],
"max_retries": 3,
"retry_interval": 60,
"created_at": "2026-02-23T10:00:00.000000Z",
"updated_at": "2026-02-23T10:00:00.000000Z"
}
}
{
"message": "You have reached the maximum number of campaigns allowed by your plan."
}
{
"message": "Assistant not found or not an outbound assistant."
}
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"assistant_id": [
"The assistant id field is required."
]
}
}
Този endpoint ви позволява да създадете нова кампания за изходящи обаждания с указаната конфигурация.
Request body
string
required
Името на кампанията. Максимум 255 символа.
integer
required
ID на асистента, който да се използва за кампанията. Трябва да бъде асистент, способен за изходящи обаждания.
string
Идентификатор на часовата зона за кампанията (напр.
America/New_York, Europe/London). По подразбиране е часовата зона на вашия акаунт.integer
default:"3"
Максимален брой едновременни обаждания. Минимум: 1. Максимумът зависи от лимита за паралелни обаждания на вашия план (до 10).
string
default:"00:00"
Начало на разрешения прозорец за обаждания в формат
H:i (напр. 09:00).string
default:"23:59"
Край на разрешения прозорец за обаждания в формат
H:i (напр. 17:00).array
default:"всичките 7 дни"
Масив от имена на дни от седмицата, когато са разрешени обаждания. Валидни стойности:
monday, tuesday, wednesday, thursday, friday, saturday, sunday.integer
default:"3"
Максимален брой опити за повторение при неуспешни обаждания. Диапазон: 1-5.
integer
default:"60"
Интервал в минути между опитите за повторение. Диапазон: 10-4320 (до 3 дни).
boolean
Дали да се повтарят обаждания, които са достигнали гласова поща.
boolean
Дали да се повтарят обаждания, при които целта не е постигната.
string
Име на boolean променлива от post-call схемата на вашия асистент за проследяване постигането на целта. Максимум 255 символа.
boolean
default:"true"
Дали автоматично да се маркира кампанията като завършена, когато няма повече оставащи потенциални клиенти за обаждане.
array
Масив от ID-та на телефонни номера за използване в кампанията. Всяко ID трябва да бъде отделно цяло число.
Response
string
Съобщение за успех, потвърждаващо, че кампанията е създадена
object
Данните на създадената кампания
Show data properties
Show data properties
integer
ID на създадената кампания
string
Името на кампанията
string
Статусът на кампанията (започва като
draft)integer
Максимален брой едновременни обаждания
boolean
Дали да се маркира кампанията като завършена, когато няма потенциални клиенти
string
Начало на разрешения прозорец за обаждания
string
Край на разрешения прозорец за обаждания
array
Дни от седмицата, когато са разрешени обаждания
integer
Максимален брой опити за повторение
integer
Интервал в минути между повторенията
string
Времева отметка, когато кампанията е създадена
string
Времева отметка, когато кампанията е последно актуализирана
Error Responses
Show Error Response
Show Error Response
string
Съобщение за грешка, когато потребителят е достигнал лимита на кампании за своя план
Show Error Response
Show Error Response
string
Съобщение за грешка, когато указаният асистент не е намерен или не е асистент за изходящи обаждания
{
"message": "Campaign created successfully",
"data": {
"id": 1,
"name": "Product Demo Campaign",
"status": "draft",
"max_calls_in_parallel": 3,
"mark_complete_when_no_leads": true,
"allowed_hours_start_time": "09:00:00",
"allowed_hours_end_time": "17:00:00",
"allowed_days": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday"
],
"max_retries": 3,
"retry_interval": 60,
"created_at": "2026-02-23T10:00:00.000000Z",
"updated_at": "2026-02-23T10:00:00.000000Z"
}
}
{
"message": "You have reached the maximum number of campaigns allowed by your plan."
}
{
"message": "Assistant not found or not an outbound assistant."
}
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"assistant_id": [
"The assistant id field is required."
]
}
}
⌘I

