Create campaign
curl --request POST \
--url https://api.staging.kathan.tech/campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-User-ID: <api-key>' \
--data '
{
"name": "<string>",
"assistant_id": "<string>",
"phone_number_id": "<string>",
"channel": "twilio",
"scheduleStartTime": "<string>",
"scheduleEndTime": "<string>",
"max_concurrency": 5,
"retry_policy": {},
"speech_settings": {
"style": "neutral",
"responsiveness": "balanced",
"interruptions": "on",
"emotions": "natural"
},
"campaign_context": "<string>",
"opening_message_template": "<string>",
"use_returning_greeting": false,
"use_short_term_summaries": false,
"short_term_summaries_limit": 123,
"machine_detection_timeout_seconds": 31,
"recipient_list_id": "<string>",
"recipients": [
{
"phone_number": "<string>",
"metadata": {},
"assistant_overrides": {}
}
]
}
'import requests
url = "https://api.staging.kathan.tech/campaign"
payload = {
"name": "<string>",
"assistant_id": "<string>",
"phone_number_id": "<string>",
"channel": "twilio",
"scheduleStartTime": "<string>",
"scheduleEndTime": "<string>",
"max_concurrency": 5,
"retry_policy": {},
"speech_settings": {
"style": "neutral",
"responsiveness": "balanced",
"interruptions": "on",
"emotions": "natural"
},
"campaign_context": "<string>",
"opening_message_template": "<string>",
"use_returning_greeting": False,
"use_short_term_summaries": False,
"short_term_summaries_limit": 123,
"machine_detection_timeout_seconds": 31,
"recipient_list_id": "<string>",
"recipients": [
{
"phone_number": "<string>",
"metadata": {},
"assistant_overrides": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"X-User-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-User-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
assistant_id: '<string>',
phone_number_id: '<string>',
channel: 'twilio',
scheduleStartTime: '<string>',
scheduleEndTime: '<string>',
max_concurrency: 5,
retry_policy: {},
speech_settings: {
style: 'neutral',
responsiveness: 'balanced',
interruptions: 'on',
emotions: 'natural'
},
campaign_context: '<string>',
opening_message_template: '<string>',
use_returning_greeting: false,
use_short_term_summaries: false,
short_term_summaries_limit: 123,
machine_detection_timeout_seconds: 31,
recipient_list_id: '<string>',
recipients: [{phone_number: '<string>', metadata: {}, assistant_overrides: {}}]
})
};
fetch('https://api.staging.kathan.tech/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://api.staging.kathan.tech/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' => '<string>',
'phone_number_id' => '<string>',
'channel' => 'twilio',
'scheduleStartTime' => '<string>',
'scheduleEndTime' => '<string>',
'max_concurrency' => 5,
'retry_policy' => [
],
'speech_settings' => [
'style' => 'neutral',
'responsiveness' => 'balanced',
'interruptions' => 'on',
'emotions' => 'natural'
],
'campaign_context' => '<string>',
'opening_message_template' => '<string>',
'use_returning_greeting' => false,
'use_short_term_summaries' => false,
'short_term_summaries_limit' => 123,
'machine_detection_timeout_seconds' => 31,
'recipient_list_id' => '<string>',
'recipients' => [
[
'phone_number' => '<string>',
'metadata' => [
],
'assistant_overrides' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-User-ID: <api-key>"
],
]);
$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://api.staging.kathan.tech/campaign"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"assistant_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"channel\": \"twilio\",\n \"scheduleStartTime\": \"<string>\",\n \"scheduleEndTime\": \"<string>\",\n \"max_concurrency\": 5,\n \"retry_policy\": {},\n \"speech_settings\": {\n \"style\": \"neutral\",\n \"responsiveness\": \"balanced\",\n \"interruptions\": \"on\",\n \"emotions\": \"natural\"\n },\n \"campaign_context\": \"<string>\",\n \"opening_message_template\": \"<string>\",\n \"use_returning_greeting\": false,\n \"use_short_term_summaries\": false,\n \"short_term_summaries_limit\": 123,\n \"machine_detection_timeout_seconds\": 31,\n \"recipient_list_id\": \"<string>\",\n \"recipients\": [\n {\n \"phone_number\": \"<string>\",\n \"metadata\": {},\n \"assistant_overrides\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-User-ID", "<api-key>")
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://api.staging.kathan.tech/campaign")
.header("Authorization", "Bearer <token>")
.header("X-User-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"assistant_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"channel\": \"twilio\",\n \"scheduleStartTime\": \"<string>\",\n \"scheduleEndTime\": \"<string>\",\n \"max_concurrency\": 5,\n \"retry_policy\": {},\n \"speech_settings\": {\n \"style\": \"neutral\",\n \"responsiveness\": \"balanced\",\n \"interruptions\": \"on\",\n \"emotions\": \"natural\"\n },\n \"campaign_context\": \"<string>\",\n \"opening_message_template\": \"<string>\",\n \"use_returning_greeting\": false,\n \"use_short_term_summaries\": false,\n \"short_term_summaries_limit\": 123,\n \"machine_detection_timeout_seconds\": 31,\n \"recipient_list_id\": \"<string>\",\n \"recipients\": [\n {\n \"phone_number\": \"<string>\",\n \"metadata\": {},\n \"assistant_overrides\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.kathan.tech/campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-User-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"assistant_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"channel\": \"twilio\",\n \"scheduleStartTime\": \"<string>\",\n \"scheduleEndTime\": \"<string>\",\n \"max_concurrency\": 5,\n \"retry_policy\": {},\n \"speech_settings\": {\n \"style\": \"neutral\",\n \"responsiveness\": \"balanced\",\n \"interruptions\": \"on\",\n \"emotions\": \"natural\"\n },\n \"campaign_context\": \"<string>\",\n \"opening_message_template\": \"<string>\",\n \"use_returning_greeting\": false,\n \"use_short_term_summaries\": false,\n \"short_term_summaries_limit\": 123,\n \"machine_detection_timeout_seconds\": 31,\n \"recipient_list_id\": \"<string>\",\n \"recipients\": [\n {\n \"phone_number\": \"<string>\",\n \"metadata\": {},\n \"assistant_overrides\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"assistant_id": "<string>",
"channel": "<string>",
"phone_number_id": "<string>",
"status": "<string>",
"max_concurrency": 123,
"retry_policy": {},
"speech_settings": {
"style": "neutral",
"responsiveness": "balanced",
"interruptions": "on",
"emotions": "natural"
},
"assistant_name": "<string>",
"caller_id_number": "<string>",
"schedule_start_time": "<string>",
"schedule_end_time": "<string>",
"campaign_context": "<string>",
"opening_message_template": "<string>",
"use_returning_greeting": false,
"use_short_term_summaries": false,
"short_term_summaries_limit": 123,
"machine_detection_timeout_seconds": 123,
"recipient_list_id": "<string>",
"recipient_list_name": "<string>",
"recipient_list_row_count": 123,
"counts": {},
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Campaigns
Create campaign
POST
/
campaign
Create campaign
curl --request POST \
--url https://api.staging.kathan.tech/campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-User-ID: <api-key>' \
--data '
{
"name": "<string>",
"assistant_id": "<string>",
"phone_number_id": "<string>",
"channel": "twilio",
"scheduleStartTime": "<string>",
"scheduleEndTime": "<string>",
"max_concurrency": 5,
"retry_policy": {},
"speech_settings": {
"style": "neutral",
"responsiveness": "balanced",
"interruptions": "on",
"emotions": "natural"
},
"campaign_context": "<string>",
"opening_message_template": "<string>",
"use_returning_greeting": false,
"use_short_term_summaries": false,
"short_term_summaries_limit": 123,
"machine_detection_timeout_seconds": 31,
"recipient_list_id": "<string>",
"recipients": [
{
"phone_number": "<string>",
"metadata": {},
"assistant_overrides": {}
}
]
}
'import requests
url = "https://api.staging.kathan.tech/campaign"
payload = {
"name": "<string>",
"assistant_id": "<string>",
"phone_number_id": "<string>",
"channel": "twilio",
"scheduleStartTime": "<string>",
"scheduleEndTime": "<string>",
"max_concurrency": 5,
"retry_policy": {},
"speech_settings": {
"style": "neutral",
"responsiveness": "balanced",
"interruptions": "on",
"emotions": "natural"
},
"campaign_context": "<string>",
"opening_message_template": "<string>",
"use_returning_greeting": False,
"use_short_term_summaries": False,
"short_term_summaries_limit": 123,
"machine_detection_timeout_seconds": 31,
"recipient_list_id": "<string>",
"recipients": [
{
"phone_number": "<string>",
"metadata": {},
"assistant_overrides": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"X-User-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-User-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
assistant_id: '<string>',
phone_number_id: '<string>',
channel: 'twilio',
scheduleStartTime: '<string>',
scheduleEndTime: '<string>',
max_concurrency: 5,
retry_policy: {},
speech_settings: {
style: 'neutral',
responsiveness: 'balanced',
interruptions: 'on',
emotions: 'natural'
},
campaign_context: '<string>',
opening_message_template: '<string>',
use_returning_greeting: false,
use_short_term_summaries: false,
short_term_summaries_limit: 123,
machine_detection_timeout_seconds: 31,
recipient_list_id: '<string>',
recipients: [{phone_number: '<string>', metadata: {}, assistant_overrides: {}}]
})
};
fetch('https://api.staging.kathan.tech/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://api.staging.kathan.tech/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' => '<string>',
'phone_number_id' => '<string>',
'channel' => 'twilio',
'scheduleStartTime' => '<string>',
'scheduleEndTime' => '<string>',
'max_concurrency' => 5,
'retry_policy' => [
],
'speech_settings' => [
'style' => 'neutral',
'responsiveness' => 'balanced',
'interruptions' => 'on',
'emotions' => 'natural'
],
'campaign_context' => '<string>',
'opening_message_template' => '<string>',
'use_returning_greeting' => false,
'use_short_term_summaries' => false,
'short_term_summaries_limit' => 123,
'machine_detection_timeout_seconds' => 31,
'recipient_list_id' => '<string>',
'recipients' => [
[
'phone_number' => '<string>',
'metadata' => [
],
'assistant_overrides' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-User-ID: <api-key>"
],
]);
$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://api.staging.kathan.tech/campaign"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"assistant_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"channel\": \"twilio\",\n \"scheduleStartTime\": \"<string>\",\n \"scheduleEndTime\": \"<string>\",\n \"max_concurrency\": 5,\n \"retry_policy\": {},\n \"speech_settings\": {\n \"style\": \"neutral\",\n \"responsiveness\": \"balanced\",\n \"interruptions\": \"on\",\n \"emotions\": \"natural\"\n },\n \"campaign_context\": \"<string>\",\n \"opening_message_template\": \"<string>\",\n \"use_returning_greeting\": false,\n \"use_short_term_summaries\": false,\n \"short_term_summaries_limit\": 123,\n \"machine_detection_timeout_seconds\": 31,\n \"recipient_list_id\": \"<string>\",\n \"recipients\": [\n {\n \"phone_number\": \"<string>\",\n \"metadata\": {},\n \"assistant_overrides\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-User-ID", "<api-key>")
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://api.staging.kathan.tech/campaign")
.header("Authorization", "Bearer <token>")
.header("X-User-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"assistant_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"channel\": \"twilio\",\n \"scheduleStartTime\": \"<string>\",\n \"scheduleEndTime\": \"<string>\",\n \"max_concurrency\": 5,\n \"retry_policy\": {},\n \"speech_settings\": {\n \"style\": \"neutral\",\n \"responsiveness\": \"balanced\",\n \"interruptions\": \"on\",\n \"emotions\": \"natural\"\n },\n \"campaign_context\": \"<string>\",\n \"opening_message_template\": \"<string>\",\n \"use_returning_greeting\": false,\n \"use_short_term_summaries\": false,\n \"short_term_summaries_limit\": 123,\n \"machine_detection_timeout_seconds\": 31,\n \"recipient_list_id\": \"<string>\",\n \"recipients\": [\n {\n \"phone_number\": \"<string>\",\n \"metadata\": {},\n \"assistant_overrides\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.kathan.tech/campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-User-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"assistant_id\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"channel\": \"twilio\",\n \"scheduleStartTime\": \"<string>\",\n \"scheduleEndTime\": \"<string>\",\n \"max_concurrency\": 5,\n \"retry_policy\": {},\n \"speech_settings\": {\n \"style\": \"neutral\",\n \"responsiveness\": \"balanced\",\n \"interruptions\": \"on\",\n \"emotions\": \"natural\"\n },\n \"campaign_context\": \"<string>\",\n \"opening_message_template\": \"<string>\",\n \"use_returning_greeting\": false,\n \"use_short_term_summaries\": false,\n \"short_term_summaries_limit\": 123,\n \"machine_detection_timeout_seconds\": 31,\n \"recipient_list_id\": \"<string>\",\n \"recipients\": [\n {\n \"phone_number\": \"<string>\",\n \"metadata\": {},\n \"assistant_overrides\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"assistant_id": "<string>",
"channel": "<string>",
"phone_number_id": "<string>",
"status": "<string>",
"max_concurrency": 123,
"retry_policy": {},
"speech_settings": {
"style": "neutral",
"responsiveness": "balanced",
"interruptions": "on",
"emotions": "natural"
},
"assistant_name": "<string>",
"caller_id_number": "<string>",
"schedule_start_time": "<string>",
"schedule_end_time": "<string>",
"campaign_context": "<string>",
"opening_message_template": "<string>",
"use_returning_greeting": false,
"use_short_term_summaries": false,
"short_term_summaries_limit": 123,
"machine_detection_timeout_seconds": 123,
"recipient_list_id": "<string>",
"recipient_list_name": "<string>",
"recipient_list_row_count": 123,
"counts": {},
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API key authentication.
Required user id for API key requests.
Body
application/json
Available options:
twilio, vobiz Required range:
1 <= x <= 200Show child attributes
Show child attributes
Voicemail/AMD detection timeout (seconds). Overrides assistant default. Single setting for all providers.
Required range:
3 <= x <= 60ID of recipient list to attach. Include in request body when creating a campaign with a list.
Show child attributes
Show child attributes
Response
Successful Response
Read-only. Server-managed: draft | running | paused | completed
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I