curl --request POST \
--url https://api.cleartalk.ai/web-agent \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumber": "+1234567890",
"max_duration": 300,
"temperature": 0.7,
"voiceSpeed": 1,
"similarity": 0.75,
"stability": 0.5,
"background_track": "background_music.mp3",
"interruptionThreshold": 1000,
"calendarID": "cal_123456",
"calendarName": "Business Hours",
"pathwayID": "path_123456",
"customTool": [],
"inboundCustomTool": [],
"waitForGreeting": true,
"questionsData": [
{
"question": "What is your name?",
"questionType": "text"
}
],
"appointmentAgent": true,
"task": "Handle customer inquiries",
"knowledgeName": "customer_support",
"transferPhoneNumber": "+1987654321",
"selectedVoice": "Maya",
"model": "enhanced",
"firstSentence": "Hello, how can I help you today?",
"selectedLanguage": "en",
"agentName": "Customer Support Agent",
"store": true,
"webSettings": {
"button_text": "<string>",
"button_background_color": "<string>",
"text_color": "<string>",
"font_size": "<string>",
"button_hover_background_color": "<string>",
"border_radius": "<string>",
"show_avatar": false,
"avatar_image_url": "<string>",
"icon_color": "<string>",
"container_background_color": "<string>",
"base_url_for_embed": "<string>",
"generated_iframe_url": "<string>",
"iframe_embed_code": "<string>",
"mobile_logo_url": "<string>",
"mobile_brand_name": "<string>",
"mobile_brand_tagline": "<string>",
"mobile_logo_position": "<string>",
"mobile_brand_name_position": "<string>",
"mobile_background_color": "<string>",
"mobile_gradient_start_color": "<string>",
"mobile_gradient_end_color": "<string>",
"mobile_text_color": "<string>",
"mobile_secondary_text_color": "<string>",
"mobile_answer_button_color": "<string>",
"mobile_end_button_color": "<string>",
"mobile_slide_bar_color": "<string>",
"mobile_slide_bar_opacity": "<string>",
"mobile_remember_me_icon": "<string>",
"mobile_message_icon": "<string>",
"mobile_phone_icon": "<string>",
"mobile_end_call_icon": "<string>",
"mobile_remind_me_text": "<string>",
"mobile_message_text": "<string>",
"mobile_slide_to_answer_text": "<string>",
"mobile_base_url_for_embed": "<string>",
"mobile_generated_iframe_url": "<string>",
"mobile_iframe_embed_code": "<string>",
"orb_button_border_radius": "<string>",
"orb_button_size": "<string>",
"orb_blink_color": "<string>",
"orb_icon_color": "<string>",
"orb_icon_size": "<string>",
"orb_button_bg_color": "<string>",
"orb_base_url": "<string>",
"orb_iframe_url": "<string>",
"orb_iframe_embed_code": "<string>"
}
}
'import requests
url = "https://api.cleartalk.ai/web-agent"
payload = {
"phoneNumber": "+1234567890",
"max_duration": 300,
"temperature": 0.7,
"voiceSpeed": 1,
"similarity": 0.75,
"stability": 0.5,
"background_track": "background_music.mp3",
"interruptionThreshold": 1000,
"calendarID": "cal_123456",
"calendarName": "Business Hours",
"pathwayID": "path_123456",
"customTool": [],
"inboundCustomTool": [],
"waitForGreeting": True,
"questionsData": [
{
"question": "What is your name?",
"questionType": "text"
}
],
"appointmentAgent": True,
"task": "Handle customer inquiries",
"knowledgeName": "customer_support",
"transferPhoneNumber": "+1987654321",
"selectedVoice": "Maya",
"model": "enhanced",
"firstSentence": "Hello, how can I help you today?",
"selectedLanguage": "en",
"agentName": "Customer Support Agent",
"store": True,
"webSettings": {
"button_text": "<string>",
"button_background_color": "<string>",
"text_color": "<string>",
"font_size": "<string>",
"button_hover_background_color": "<string>",
"border_radius": "<string>",
"show_avatar": False,
"avatar_image_url": "<string>",
"icon_color": "<string>",
"container_background_color": "<string>",
"base_url_for_embed": "<string>",
"generated_iframe_url": "<string>",
"iframe_embed_code": "<string>",
"mobile_logo_url": "<string>",
"mobile_brand_name": "<string>",
"mobile_brand_tagline": "<string>",
"mobile_logo_position": "<string>",
"mobile_brand_name_position": "<string>",
"mobile_background_color": "<string>",
"mobile_gradient_start_color": "<string>",
"mobile_gradient_end_color": "<string>",
"mobile_text_color": "<string>",
"mobile_secondary_text_color": "<string>",
"mobile_answer_button_color": "<string>",
"mobile_end_button_color": "<string>",
"mobile_slide_bar_color": "<string>",
"mobile_slide_bar_opacity": "<string>",
"mobile_remember_me_icon": "<string>",
"mobile_message_icon": "<string>",
"mobile_phone_icon": "<string>",
"mobile_end_call_icon": "<string>",
"mobile_remind_me_text": "<string>",
"mobile_message_text": "<string>",
"mobile_slide_to_answer_text": "<string>",
"mobile_base_url_for_embed": "<string>",
"mobile_generated_iframe_url": "<string>",
"mobile_iframe_embed_code": "<string>",
"orb_button_border_radius": "<string>",
"orb_button_size": "<string>",
"orb_blink_color": "<string>",
"orb_icon_color": "<string>",
"orb_icon_size": "<string>",
"orb_button_bg_color": "<string>",
"orb_base_url": "<string>",
"orb_iframe_url": "<string>",
"orb_iframe_embed_code": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '+1234567890',
max_duration: 300,
temperature: 0.7,
voiceSpeed: 1,
similarity: 0.75,
stability: 0.5,
background_track: 'background_music.mp3',
interruptionThreshold: 1000,
calendarID: 'cal_123456',
calendarName: 'Business Hours',
pathwayID: 'path_123456',
customTool: [],
inboundCustomTool: [],
waitForGreeting: true,
questionsData: [{question: 'What is your name?', questionType: 'text'}],
appointmentAgent: true,
task: 'Handle customer inquiries',
knowledgeName: 'customer_support',
transferPhoneNumber: '+1987654321',
selectedVoice: 'Maya',
model: 'enhanced',
firstSentence: 'Hello, how can I help you today?',
selectedLanguage: 'en',
agentName: 'Customer Support Agent',
store: true,
webSettings: {
button_text: '<string>',
button_background_color: '<string>',
text_color: '<string>',
font_size: '<string>',
button_hover_background_color: '<string>',
border_radius: '<string>',
show_avatar: false,
avatar_image_url: '<string>',
icon_color: '<string>',
container_background_color: '<string>',
base_url_for_embed: '<string>',
generated_iframe_url: '<string>',
iframe_embed_code: '<string>',
mobile_logo_url: '<string>',
mobile_brand_name: '<string>',
mobile_brand_tagline: '<string>',
mobile_logo_position: '<string>',
mobile_brand_name_position: '<string>',
mobile_background_color: '<string>',
mobile_gradient_start_color: '<string>',
mobile_gradient_end_color: '<string>',
mobile_text_color: '<string>',
mobile_secondary_text_color: '<string>',
mobile_answer_button_color: '<string>',
mobile_end_button_color: '<string>',
mobile_slide_bar_color: '<string>',
mobile_slide_bar_opacity: '<string>',
mobile_remember_me_icon: '<string>',
mobile_message_icon: '<string>',
mobile_phone_icon: '<string>',
mobile_end_call_icon: '<string>',
mobile_remind_me_text: '<string>',
mobile_message_text: '<string>',
mobile_slide_to_answer_text: '<string>',
mobile_base_url_for_embed: '<string>',
mobile_generated_iframe_url: '<string>',
mobile_iframe_embed_code: '<string>',
orb_button_border_radius: '<string>',
orb_button_size: '<string>',
orb_blink_color: '<string>',
orb_icon_color: '<string>',
orb_icon_size: '<string>',
orb_button_bg_color: '<string>',
orb_base_url: '<string>',
orb_iframe_url: '<string>',
orb_iframe_embed_code: '<string>'
}
})
};
fetch('https://api.cleartalk.ai/web-agent', 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.cleartalk.ai/web-agent",
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([
'phoneNumber' => '+1234567890',
'max_duration' => 300,
'temperature' => 0.7,
'voiceSpeed' => 1,
'similarity' => 0.75,
'stability' => 0.5,
'background_track' => 'background_music.mp3',
'interruptionThreshold' => 1000,
'calendarID' => 'cal_123456',
'calendarName' => 'Business Hours',
'pathwayID' => 'path_123456',
'customTool' => [
],
'inboundCustomTool' => [
],
'waitForGreeting' => true,
'questionsData' => [
[
'question' => 'What is your name?',
'questionType' => 'text'
]
],
'appointmentAgent' => true,
'task' => 'Handle customer inquiries',
'knowledgeName' => 'customer_support',
'transferPhoneNumber' => '+1987654321',
'selectedVoice' => 'Maya',
'model' => 'enhanced',
'firstSentence' => 'Hello, how can I help you today?',
'selectedLanguage' => 'en',
'agentName' => 'Customer Support Agent',
'store' => true,
'webSettings' => [
'button_text' => '<string>',
'button_background_color' => '<string>',
'text_color' => '<string>',
'font_size' => '<string>',
'button_hover_background_color' => '<string>',
'border_radius' => '<string>',
'show_avatar' => false,
'avatar_image_url' => '<string>',
'icon_color' => '<string>',
'container_background_color' => '<string>',
'base_url_for_embed' => '<string>',
'generated_iframe_url' => '<string>',
'iframe_embed_code' => '<string>',
'mobile_logo_url' => '<string>',
'mobile_brand_name' => '<string>',
'mobile_brand_tagline' => '<string>',
'mobile_logo_position' => '<string>',
'mobile_brand_name_position' => '<string>',
'mobile_background_color' => '<string>',
'mobile_gradient_start_color' => '<string>',
'mobile_gradient_end_color' => '<string>',
'mobile_text_color' => '<string>',
'mobile_secondary_text_color' => '<string>',
'mobile_answer_button_color' => '<string>',
'mobile_end_button_color' => '<string>',
'mobile_slide_bar_color' => '<string>',
'mobile_slide_bar_opacity' => '<string>',
'mobile_remember_me_icon' => '<string>',
'mobile_message_icon' => '<string>',
'mobile_phone_icon' => '<string>',
'mobile_end_call_icon' => '<string>',
'mobile_remind_me_text' => '<string>',
'mobile_message_text' => '<string>',
'mobile_slide_to_answer_text' => '<string>',
'mobile_base_url_for_embed' => '<string>',
'mobile_generated_iframe_url' => '<string>',
'mobile_iframe_embed_code' => '<string>',
'orb_button_border_radius' => '<string>',
'orb_button_size' => '<string>',
'orb_blink_color' => '<string>',
'orb_icon_color' => '<string>',
'orb_icon_size' => '<string>',
'orb_button_bg_color' => '<string>',
'orb_base_url' => '<string>',
'orb_iframe_url' => '<string>',
'orb_iframe_embed_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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.cleartalk.ai/web-agent"
payload := strings.NewReader("{\n \"phoneNumber\": \"+1234567890\",\n \"max_duration\": 300,\n \"temperature\": 0.7,\n \"voiceSpeed\": 1,\n \"similarity\": 0.75,\n \"stability\": 0.5,\n \"background_track\": \"background_music.mp3\",\n \"interruptionThreshold\": 1000,\n \"calendarID\": \"cal_123456\",\n \"calendarName\": \"Business Hours\",\n \"pathwayID\": \"path_123456\",\n \"customTool\": [],\n \"inboundCustomTool\": [],\n \"waitForGreeting\": true,\n \"questionsData\": [\n {\n \"question\": \"What is your name?\",\n \"questionType\": \"text\"\n }\n ],\n \"appointmentAgent\": true,\n \"task\": \"Handle customer inquiries\",\n \"knowledgeName\": \"customer_support\",\n \"transferPhoneNumber\": \"+1987654321\",\n \"selectedVoice\": \"Maya\",\n \"model\": \"enhanced\",\n \"firstSentence\": \"Hello, how can I help you today?\",\n \"selectedLanguage\": \"en\",\n \"agentName\": \"Customer Support Agent\",\n \"store\": true,\n \"webSettings\": {\n \"button_text\": \"<string>\",\n \"button_background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"font_size\": \"<string>\",\n \"button_hover_background_color\": \"<string>\",\n \"border_radius\": \"<string>\",\n \"show_avatar\": false,\n \"avatar_image_url\": \"<string>\",\n \"icon_color\": \"<string>\",\n \"container_background_color\": \"<string>\",\n \"base_url_for_embed\": \"<string>\",\n \"generated_iframe_url\": \"<string>\",\n \"iframe_embed_code\": \"<string>\",\n \"mobile_logo_url\": \"<string>\",\n \"mobile_brand_name\": \"<string>\",\n \"mobile_brand_tagline\": \"<string>\",\n \"mobile_logo_position\": \"<string>\",\n \"mobile_brand_name_position\": \"<string>\",\n \"mobile_background_color\": \"<string>\",\n \"mobile_gradient_start_color\": \"<string>\",\n \"mobile_gradient_end_color\": \"<string>\",\n \"mobile_text_color\": \"<string>\",\n \"mobile_secondary_text_color\": \"<string>\",\n \"mobile_answer_button_color\": \"<string>\",\n \"mobile_end_button_color\": \"<string>\",\n \"mobile_slide_bar_color\": \"<string>\",\n \"mobile_slide_bar_opacity\": \"<string>\",\n \"mobile_remember_me_icon\": \"<string>\",\n \"mobile_message_icon\": \"<string>\",\n \"mobile_phone_icon\": \"<string>\",\n \"mobile_end_call_icon\": \"<string>\",\n \"mobile_remind_me_text\": \"<string>\",\n \"mobile_message_text\": \"<string>\",\n \"mobile_slide_to_answer_text\": \"<string>\",\n \"mobile_base_url_for_embed\": \"<string>\",\n \"mobile_generated_iframe_url\": \"<string>\",\n \"mobile_iframe_embed_code\": \"<string>\",\n \"orb_button_border_radius\": \"<string>\",\n \"orb_button_size\": \"<string>\",\n \"orb_blink_color\": \"<string>\",\n \"orb_icon_color\": \"<string>\",\n \"orb_icon_size\": \"<string>\",\n \"orb_button_bg_color\": \"<string>\",\n \"orb_base_url\": \"<string>\",\n \"orb_iframe_url\": \"<string>\",\n \"orb_iframe_embed_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.cleartalk.ai/web-agent")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+1234567890\",\n \"max_duration\": 300,\n \"temperature\": 0.7,\n \"voiceSpeed\": 1,\n \"similarity\": 0.75,\n \"stability\": 0.5,\n \"background_track\": \"background_music.mp3\",\n \"interruptionThreshold\": 1000,\n \"calendarID\": \"cal_123456\",\n \"calendarName\": \"Business Hours\",\n \"pathwayID\": \"path_123456\",\n \"customTool\": [],\n \"inboundCustomTool\": [],\n \"waitForGreeting\": true,\n \"questionsData\": [\n {\n \"question\": \"What is your name?\",\n \"questionType\": \"text\"\n }\n ],\n \"appointmentAgent\": true,\n \"task\": \"Handle customer inquiries\",\n \"knowledgeName\": \"customer_support\",\n \"transferPhoneNumber\": \"+1987654321\",\n \"selectedVoice\": \"Maya\",\n \"model\": \"enhanced\",\n \"firstSentence\": \"Hello, how can I help you today?\",\n \"selectedLanguage\": \"en\",\n \"agentName\": \"Customer Support Agent\",\n \"store\": true,\n \"webSettings\": {\n \"button_text\": \"<string>\",\n \"button_background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"font_size\": \"<string>\",\n \"button_hover_background_color\": \"<string>\",\n \"border_radius\": \"<string>\",\n \"show_avatar\": false,\n \"avatar_image_url\": \"<string>\",\n \"icon_color\": \"<string>\",\n \"container_background_color\": \"<string>\",\n \"base_url_for_embed\": \"<string>\",\n \"generated_iframe_url\": \"<string>\",\n \"iframe_embed_code\": \"<string>\",\n \"mobile_logo_url\": \"<string>\",\n \"mobile_brand_name\": \"<string>\",\n \"mobile_brand_tagline\": \"<string>\",\n \"mobile_logo_position\": \"<string>\",\n \"mobile_brand_name_position\": \"<string>\",\n \"mobile_background_color\": \"<string>\",\n \"mobile_gradient_start_color\": \"<string>\",\n \"mobile_gradient_end_color\": \"<string>\",\n \"mobile_text_color\": \"<string>\",\n \"mobile_secondary_text_color\": \"<string>\",\n \"mobile_answer_button_color\": \"<string>\",\n \"mobile_end_button_color\": \"<string>\",\n \"mobile_slide_bar_color\": \"<string>\",\n \"mobile_slide_bar_opacity\": \"<string>\",\n \"mobile_remember_me_icon\": \"<string>\",\n \"mobile_message_icon\": \"<string>\",\n \"mobile_phone_icon\": \"<string>\",\n \"mobile_end_call_icon\": \"<string>\",\n \"mobile_remind_me_text\": \"<string>\",\n \"mobile_message_text\": \"<string>\",\n \"mobile_slide_to_answer_text\": \"<string>\",\n \"mobile_base_url_for_embed\": \"<string>\",\n \"mobile_generated_iframe_url\": \"<string>\",\n \"mobile_iframe_embed_code\": \"<string>\",\n \"orb_button_border_radius\": \"<string>\",\n \"orb_button_size\": \"<string>\",\n \"orb_blink_color\": \"<string>\",\n \"orb_icon_color\": \"<string>\",\n \"orb_icon_size\": \"<string>\",\n \"orb_button_bg_color\": \"<string>\",\n \"orb_base_url\": \"<string>\",\n \"orb_iframe_url\": \"<string>\",\n \"orb_iframe_embed_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/web-agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"+1234567890\",\n \"max_duration\": 300,\n \"temperature\": 0.7,\n \"voiceSpeed\": 1,\n \"similarity\": 0.75,\n \"stability\": 0.5,\n \"background_track\": \"background_music.mp3\",\n \"interruptionThreshold\": 1000,\n \"calendarID\": \"cal_123456\",\n \"calendarName\": \"Business Hours\",\n \"pathwayID\": \"path_123456\",\n \"customTool\": [],\n \"inboundCustomTool\": [],\n \"waitForGreeting\": true,\n \"questionsData\": [\n {\n \"question\": \"What is your name?\",\n \"questionType\": \"text\"\n }\n ],\n \"appointmentAgent\": true,\n \"task\": \"Handle customer inquiries\",\n \"knowledgeName\": \"customer_support\",\n \"transferPhoneNumber\": \"+1987654321\",\n \"selectedVoice\": \"Maya\",\n \"model\": \"enhanced\",\n \"firstSentence\": \"Hello, how can I help you today?\",\n \"selectedLanguage\": \"en\",\n \"agentName\": \"Customer Support Agent\",\n \"store\": true,\n \"webSettings\": {\n \"button_text\": \"<string>\",\n \"button_background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"font_size\": \"<string>\",\n \"button_hover_background_color\": \"<string>\",\n \"border_radius\": \"<string>\",\n \"show_avatar\": false,\n \"avatar_image_url\": \"<string>\",\n \"icon_color\": \"<string>\",\n \"container_background_color\": \"<string>\",\n \"base_url_for_embed\": \"<string>\",\n \"generated_iframe_url\": \"<string>\",\n \"iframe_embed_code\": \"<string>\",\n \"mobile_logo_url\": \"<string>\",\n \"mobile_brand_name\": \"<string>\",\n \"mobile_brand_tagline\": \"<string>\",\n \"mobile_logo_position\": \"<string>\",\n \"mobile_brand_name_position\": \"<string>\",\n \"mobile_background_color\": \"<string>\",\n \"mobile_gradient_start_color\": \"<string>\",\n \"mobile_gradient_end_color\": \"<string>\",\n \"mobile_text_color\": \"<string>\",\n \"mobile_secondary_text_color\": \"<string>\",\n \"mobile_answer_button_color\": \"<string>\",\n \"mobile_end_button_color\": \"<string>\",\n \"mobile_slide_bar_color\": \"<string>\",\n \"mobile_slide_bar_opacity\": \"<string>\",\n \"mobile_remember_me_icon\": \"<string>\",\n \"mobile_message_icon\": \"<string>\",\n \"mobile_phone_icon\": \"<string>\",\n \"mobile_end_call_icon\": \"<string>\",\n \"mobile_remind_me_text\": \"<string>\",\n \"mobile_message_text\": \"<string>\",\n \"mobile_slide_to_answer_text\": \"<string>\",\n \"mobile_base_url_for_embed\": \"<string>\",\n \"mobile_generated_iframe_url\": \"<string>\",\n \"mobile_iframe_embed_code\": \"<string>\",\n \"orb_button_border_radius\": \"<string>\",\n \"orb_button_size\": \"<string>\",\n \"orb_blink_color\": \"<string>\",\n \"orb_icon_color\": \"<string>\",\n \"orb_icon_size\": \"<string>\",\n \"orb_button_bg_color\": \"<string>\",\n \"orb_base_url\": \"<string>\",\n \"orb_iframe_url\": \"<string>\",\n \"orb_iframe_embed_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Agent created successfully",
"agent_id": "agent_123456"
}Create a new web agent
curl --request POST \
--url https://api.cleartalk.ai/web-agent \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumber": "+1234567890",
"max_duration": 300,
"temperature": 0.7,
"voiceSpeed": 1,
"similarity": 0.75,
"stability": 0.5,
"background_track": "background_music.mp3",
"interruptionThreshold": 1000,
"calendarID": "cal_123456",
"calendarName": "Business Hours",
"pathwayID": "path_123456",
"customTool": [],
"inboundCustomTool": [],
"waitForGreeting": true,
"questionsData": [
{
"question": "What is your name?",
"questionType": "text"
}
],
"appointmentAgent": true,
"task": "Handle customer inquiries",
"knowledgeName": "customer_support",
"transferPhoneNumber": "+1987654321",
"selectedVoice": "Maya",
"model": "enhanced",
"firstSentence": "Hello, how can I help you today?",
"selectedLanguage": "en",
"agentName": "Customer Support Agent",
"store": true,
"webSettings": {
"button_text": "<string>",
"button_background_color": "<string>",
"text_color": "<string>",
"font_size": "<string>",
"button_hover_background_color": "<string>",
"border_radius": "<string>",
"show_avatar": false,
"avatar_image_url": "<string>",
"icon_color": "<string>",
"container_background_color": "<string>",
"base_url_for_embed": "<string>",
"generated_iframe_url": "<string>",
"iframe_embed_code": "<string>",
"mobile_logo_url": "<string>",
"mobile_brand_name": "<string>",
"mobile_brand_tagline": "<string>",
"mobile_logo_position": "<string>",
"mobile_brand_name_position": "<string>",
"mobile_background_color": "<string>",
"mobile_gradient_start_color": "<string>",
"mobile_gradient_end_color": "<string>",
"mobile_text_color": "<string>",
"mobile_secondary_text_color": "<string>",
"mobile_answer_button_color": "<string>",
"mobile_end_button_color": "<string>",
"mobile_slide_bar_color": "<string>",
"mobile_slide_bar_opacity": "<string>",
"mobile_remember_me_icon": "<string>",
"mobile_message_icon": "<string>",
"mobile_phone_icon": "<string>",
"mobile_end_call_icon": "<string>",
"mobile_remind_me_text": "<string>",
"mobile_message_text": "<string>",
"mobile_slide_to_answer_text": "<string>",
"mobile_base_url_for_embed": "<string>",
"mobile_generated_iframe_url": "<string>",
"mobile_iframe_embed_code": "<string>",
"orb_button_border_radius": "<string>",
"orb_button_size": "<string>",
"orb_blink_color": "<string>",
"orb_icon_color": "<string>",
"orb_icon_size": "<string>",
"orb_button_bg_color": "<string>",
"orb_base_url": "<string>",
"orb_iframe_url": "<string>",
"orb_iframe_embed_code": "<string>"
}
}
'import requests
url = "https://api.cleartalk.ai/web-agent"
payload = {
"phoneNumber": "+1234567890",
"max_duration": 300,
"temperature": 0.7,
"voiceSpeed": 1,
"similarity": 0.75,
"stability": 0.5,
"background_track": "background_music.mp3",
"interruptionThreshold": 1000,
"calendarID": "cal_123456",
"calendarName": "Business Hours",
"pathwayID": "path_123456",
"customTool": [],
"inboundCustomTool": [],
"waitForGreeting": True,
"questionsData": [
{
"question": "What is your name?",
"questionType": "text"
}
],
"appointmentAgent": True,
"task": "Handle customer inquiries",
"knowledgeName": "customer_support",
"transferPhoneNumber": "+1987654321",
"selectedVoice": "Maya",
"model": "enhanced",
"firstSentence": "Hello, how can I help you today?",
"selectedLanguage": "en",
"agentName": "Customer Support Agent",
"store": True,
"webSettings": {
"button_text": "<string>",
"button_background_color": "<string>",
"text_color": "<string>",
"font_size": "<string>",
"button_hover_background_color": "<string>",
"border_radius": "<string>",
"show_avatar": False,
"avatar_image_url": "<string>",
"icon_color": "<string>",
"container_background_color": "<string>",
"base_url_for_embed": "<string>",
"generated_iframe_url": "<string>",
"iframe_embed_code": "<string>",
"mobile_logo_url": "<string>",
"mobile_brand_name": "<string>",
"mobile_brand_tagline": "<string>",
"mobile_logo_position": "<string>",
"mobile_brand_name_position": "<string>",
"mobile_background_color": "<string>",
"mobile_gradient_start_color": "<string>",
"mobile_gradient_end_color": "<string>",
"mobile_text_color": "<string>",
"mobile_secondary_text_color": "<string>",
"mobile_answer_button_color": "<string>",
"mobile_end_button_color": "<string>",
"mobile_slide_bar_color": "<string>",
"mobile_slide_bar_opacity": "<string>",
"mobile_remember_me_icon": "<string>",
"mobile_message_icon": "<string>",
"mobile_phone_icon": "<string>",
"mobile_end_call_icon": "<string>",
"mobile_remind_me_text": "<string>",
"mobile_message_text": "<string>",
"mobile_slide_to_answer_text": "<string>",
"mobile_base_url_for_embed": "<string>",
"mobile_generated_iframe_url": "<string>",
"mobile_iframe_embed_code": "<string>",
"orb_button_border_radius": "<string>",
"orb_button_size": "<string>",
"orb_blink_color": "<string>",
"orb_icon_color": "<string>",
"orb_icon_size": "<string>",
"orb_button_bg_color": "<string>",
"orb_base_url": "<string>",
"orb_iframe_url": "<string>",
"orb_iframe_embed_code": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '+1234567890',
max_duration: 300,
temperature: 0.7,
voiceSpeed: 1,
similarity: 0.75,
stability: 0.5,
background_track: 'background_music.mp3',
interruptionThreshold: 1000,
calendarID: 'cal_123456',
calendarName: 'Business Hours',
pathwayID: 'path_123456',
customTool: [],
inboundCustomTool: [],
waitForGreeting: true,
questionsData: [{question: 'What is your name?', questionType: 'text'}],
appointmentAgent: true,
task: 'Handle customer inquiries',
knowledgeName: 'customer_support',
transferPhoneNumber: '+1987654321',
selectedVoice: 'Maya',
model: 'enhanced',
firstSentence: 'Hello, how can I help you today?',
selectedLanguage: 'en',
agentName: 'Customer Support Agent',
store: true,
webSettings: {
button_text: '<string>',
button_background_color: '<string>',
text_color: '<string>',
font_size: '<string>',
button_hover_background_color: '<string>',
border_radius: '<string>',
show_avatar: false,
avatar_image_url: '<string>',
icon_color: '<string>',
container_background_color: '<string>',
base_url_for_embed: '<string>',
generated_iframe_url: '<string>',
iframe_embed_code: '<string>',
mobile_logo_url: '<string>',
mobile_brand_name: '<string>',
mobile_brand_tagline: '<string>',
mobile_logo_position: '<string>',
mobile_brand_name_position: '<string>',
mobile_background_color: '<string>',
mobile_gradient_start_color: '<string>',
mobile_gradient_end_color: '<string>',
mobile_text_color: '<string>',
mobile_secondary_text_color: '<string>',
mobile_answer_button_color: '<string>',
mobile_end_button_color: '<string>',
mobile_slide_bar_color: '<string>',
mobile_slide_bar_opacity: '<string>',
mobile_remember_me_icon: '<string>',
mobile_message_icon: '<string>',
mobile_phone_icon: '<string>',
mobile_end_call_icon: '<string>',
mobile_remind_me_text: '<string>',
mobile_message_text: '<string>',
mobile_slide_to_answer_text: '<string>',
mobile_base_url_for_embed: '<string>',
mobile_generated_iframe_url: '<string>',
mobile_iframe_embed_code: '<string>',
orb_button_border_radius: '<string>',
orb_button_size: '<string>',
orb_blink_color: '<string>',
orb_icon_color: '<string>',
orb_icon_size: '<string>',
orb_button_bg_color: '<string>',
orb_base_url: '<string>',
orb_iframe_url: '<string>',
orb_iframe_embed_code: '<string>'
}
})
};
fetch('https://api.cleartalk.ai/web-agent', 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.cleartalk.ai/web-agent",
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([
'phoneNumber' => '+1234567890',
'max_duration' => 300,
'temperature' => 0.7,
'voiceSpeed' => 1,
'similarity' => 0.75,
'stability' => 0.5,
'background_track' => 'background_music.mp3',
'interruptionThreshold' => 1000,
'calendarID' => 'cal_123456',
'calendarName' => 'Business Hours',
'pathwayID' => 'path_123456',
'customTool' => [
],
'inboundCustomTool' => [
],
'waitForGreeting' => true,
'questionsData' => [
[
'question' => 'What is your name?',
'questionType' => 'text'
]
],
'appointmentAgent' => true,
'task' => 'Handle customer inquiries',
'knowledgeName' => 'customer_support',
'transferPhoneNumber' => '+1987654321',
'selectedVoice' => 'Maya',
'model' => 'enhanced',
'firstSentence' => 'Hello, how can I help you today?',
'selectedLanguage' => 'en',
'agentName' => 'Customer Support Agent',
'store' => true,
'webSettings' => [
'button_text' => '<string>',
'button_background_color' => '<string>',
'text_color' => '<string>',
'font_size' => '<string>',
'button_hover_background_color' => '<string>',
'border_radius' => '<string>',
'show_avatar' => false,
'avatar_image_url' => '<string>',
'icon_color' => '<string>',
'container_background_color' => '<string>',
'base_url_for_embed' => '<string>',
'generated_iframe_url' => '<string>',
'iframe_embed_code' => '<string>',
'mobile_logo_url' => '<string>',
'mobile_brand_name' => '<string>',
'mobile_brand_tagline' => '<string>',
'mobile_logo_position' => '<string>',
'mobile_brand_name_position' => '<string>',
'mobile_background_color' => '<string>',
'mobile_gradient_start_color' => '<string>',
'mobile_gradient_end_color' => '<string>',
'mobile_text_color' => '<string>',
'mobile_secondary_text_color' => '<string>',
'mobile_answer_button_color' => '<string>',
'mobile_end_button_color' => '<string>',
'mobile_slide_bar_color' => '<string>',
'mobile_slide_bar_opacity' => '<string>',
'mobile_remember_me_icon' => '<string>',
'mobile_message_icon' => '<string>',
'mobile_phone_icon' => '<string>',
'mobile_end_call_icon' => '<string>',
'mobile_remind_me_text' => '<string>',
'mobile_message_text' => '<string>',
'mobile_slide_to_answer_text' => '<string>',
'mobile_base_url_for_embed' => '<string>',
'mobile_generated_iframe_url' => '<string>',
'mobile_iframe_embed_code' => '<string>',
'orb_button_border_radius' => '<string>',
'orb_button_size' => '<string>',
'orb_blink_color' => '<string>',
'orb_icon_color' => '<string>',
'orb_icon_size' => '<string>',
'orb_button_bg_color' => '<string>',
'orb_base_url' => '<string>',
'orb_iframe_url' => '<string>',
'orb_iframe_embed_code' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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.cleartalk.ai/web-agent"
payload := strings.NewReader("{\n \"phoneNumber\": \"+1234567890\",\n \"max_duration\": 300,\n \"temperature\": 0.7,\n \"voiceSpeed\": 1,\n \"similarity\": 0.75,\n \"stability\": 0.5,\n \"background_track\": \"background_music.mp3\",\n \"interruptionThreshold\": 1000,\n \"calendarID\": \"cal_123456\",\n \"calendarName\": \"Business Hours\",\n \"pathwayID\": \"path_123456\",\n \"customTool\": [],\n \"inboundCustomTool\": [],\n \"waitForGreeting\": true,\n \"questionsData\": [\n {\n \"question\": \"What is your name?\",\n \"questionType\": \"text\"\n }\n ],\n \"appointmentAgent\": true,\n \"task\": \"Handle customer inquiries\",\n \"knowledgeName\": \"customer_support\",\n \"transferPhoneNumber\": \"+1987654321\",\n \"selectedVoice\": \"Maya\",\n \"model\": \"enhanced\",\n \"firstSentence\": \"Hello, how can I help you today?\",\n \"selectedLanguage\": \"en\",\n \"agentName\": \"Customer Support Agent\",\n \"store\": true,\n \"webSettings\": {\n \"button_text\": \"<string>\",\n \"button_background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"font_size\": \"<string>\",\n \"button_hover_background_color\": \"<string>\",\n \"border_radius\": \"<string>\",\n \"show_avatar\": false,\n \"avatar_image_url\": \"<string>\",\n \"icon_color\": \"<string>\",\n \"container_background_color\": \"<string>\",\n \"base_url_for_embed\": \"<string>\",\n \"generated_iframe_url\": \"<string>\",\n \"iframe_embed_code\": \"<string>\",\n \"mobile_logo_url\": \"<string>\",\n \"mobile_brand_name\": \"<string>\",\n \"mobile_brand_tagline\": \"<string>\",\n \"mobile_logo_position\": \"<string>\",\n \"mobile_brand_name_position\": \"<string>\",\n \"mobile_background_color\": \"<string>\",\n \"mobile_gradient_start_color\": \"<string>\",\n \"mobile_gradient_end_color\": \"<string>\",\n \"mobile_text_color\": \"<string>\",\n \"mobile_secondary_text_color\": \"<string>\",\n \"mobile_answer_button_color\": \"<string>\",\n \"mobile_end_button_color\": \"<string>\",\n \"mobile_slide_bar_color\": \"<string>\",\n \"mobile_slide_bar_opacity\": \"<string>\",\n \"mobile_remember_me_icon\": \"<string>\",\n \"mobile_message_icon\": \"<string>\",\n \"mobile_phone_icon\": \"<string>\",\n \"mobile_end_call_icon\": \"<string>\",\n \"mobile_remind_me_text\": \"<string>\",\n \"mobile_message_text\": \"<string>\",\n \"mobile_slide_to_answer_text\": \"<string>\",\n \"mobile_base_url_for_embed\": \"<string>\",\n \"mobile_generated_iframe_url\": \"<string>\",\n \"mobile_iframe_embed_code\": \"<string>\",\n \"orb_button_border_radius\": \"<string>\",\n \"orb_button_size\": \"<string>\",\n \"orb_blink_color\": \"<string>\",\n \"orb_icon_color\": \"<string>\",\n \"orb_icon_size\": \"<string>\",\n \"orb_button_bg_color\": \"<string>\",\n \"orb_base_url\": \"<string>\",\n \"orb_iframe_url\": \"<string>\",\n \"orb_iframe_embed_code\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.cleartalk.ai/web-agent")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+1234567890\",\n \"max_duration\": 300,\n \"temperature\": 0.7,\n \"voiceSpeed\": 1,\n \"similarity\": 0.75,\n \"stability\": 0.5,\n \"background_track\": \"background_music.mp3\",\n \"interruptionThreshold\": 1000,\n \"calendarID\": \"cal_123456\",\n \"calendarName\": \"Business Hours\",\n \"pathwayID\": \"path_123456\",\n \"customTool\": [],\n \"inboundCustomTool\": [],\n \"waitForGreeting\": true,\n \"questionsData\": [\n {\n \"question\": \"What is your name?\",\n \"questionType\": \"text\"\n }\n ],\n \"appointmentAgent\": true,\n \"task\": \"Handle customer inquiries\",\n \"knowledgeName\": \"customer_support\",\n \"transferPhoneNumber\": \"+1987654321\",\n \"selectedVoice\": \"Maya\",\n \"model\": \"enhanced\",\n \"firstSentence\": \"Hello, how can I help you today?\",\n \"selectedLanguage\": \"en\",\n \"agentName\": \"Customer Support Agent\",\n \"store\": true,\n \"webSettings\": {\n \"button_text\": \"<string>\",\n \"button_background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"font_size\": \"<string>\",\n \"button_hover_background_color\": \"<string>\",\n \"border_radius\": \"<string>\",\n \"show_avatar\": false,\n \"avatar_image_url\": \"<string>\",\n \"icon_color\": \"<string>\",\n \"container_background_color\": \"<string>\",\n \"base_url_for_embed\": \"<string>\",\n \"generated_iframe_url\": \"<string>\",\n \"iframe_embed_code\": \"<string>\",\n \"mobile_logo_url\": \"<string>\",\n \"mobile_brand_name\": \"<string>\",\n \"mobile_brand_tagline\": \"<string>\",\n \"mobile_logo_position\": \"<string>\",\n \"mobile_brand_name_position\": \"<string>\",\n \"mobile_background_color\": \"<string>\",\n \"mobile_gradient_start_color\": \"<string>\",\n \"mobile_gradient_end_color\": \"<string>\",\n \"mobile_text_color\": \"<string>\",\n \"mobile_secondary_text_color\": \"<string>\",\n \"mobile_answer_button_color\": \"<string>\",\n \"mobile_end_button_color\": \"<string>\",\n \"mobile_slide_bar_color\": \"<string>\",\n \"mobile_slide_bar_opacity\": \"<string>\",\n \"mobile_remember_me_icon\": \"<string>\",\n \"mobile_message_icon\": \"<string>\",\n \"mobile_phone_icon\": \"<string>\",\n \"mobile_end_call_icon\": \"<string>\",\n \"mobile_remind_me_text\": \"<string>\",\n \"mobile_message_text\": \"<string>\",\n \"mobile_slide_to_answer_text\": \"<string>\",\n \"mobile_base_url_for_embed\": \"<string>\",\n \"mobile_generated_iframe_url\": \"<string>\",\n \"mobile_iframe_embed_code\": \"<string>\",\n \"orb_button_border_radius\": \"<string>\",\n \"orb_button_size\": \"<string>\",\n \"orb_blink_color\": \"<string>\",\n \"orb_icon_color\": \"<string>\",\n \"orb_icon_size\": \"<string>\",\n \"orb_button_bg_color\": \"<string>\",\n \"orb_base_url\": \"<string>\",\n \"orb_iframe_url\": \"<string>\",\n \"orb_iframe_embed_code\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/web-agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"+1234567890\",\n \"max_duration\": 300,\n \"temperature\": 0.7,\n \"voiceSpeed\": 1,\n \"similarity\": 0.75,\n \"stability\": 0.5,\n \"background_track\": \"background_music.mp3\",\n \"interruptionThreshold\": 1000,\n \"calendarID\": \"cal_123456\",\n \"calendarName\": \"Business Hours\",\n \"pathwayID\": \"path_123456\",\n \"customTool\": [],\n \"inboundCustomTool\": [],\n \"waitForGreeting\": true,\n \"questionsData\": [\n {\n \"question\": \"What is your name?\",\n \"questionType\": \"text\"\n }\n ],\n \"appointmentAgent\": true,\n \"task\": \"Handle customer inquiries\",\n \"knowledgeName\": \"customer_support\",\n \"transferPhoneNumber\": \"+1987654321\",\n \"selectedVoice\": \"Maya\",\n \"model\": \"enhanced\",\n \"firstSentence\": \"Hello, how can I help you today?\",\n \"selectedLanguage\": \"en\",\n \"agentName\": \"Customer Support Agent\",\n \"store\": true,\n \"webSettings\": {\n \"button_text\": \"<string>\",\n \"button_background_color\": \"<string>\",\n \"text_color\": \"<string>\",\n \"font_size\": \"<string>\",\n \"button_hover_background_color\": \"<string>\",\n \"border_radius\": \"<string>\",\n \"show_avatar\": false,\n \"avatar_image_url\": \"<string>\",\n \"icon_color\": \"<string>\",\n \"container_background_color\": \"<string>\",\n \"base_url_for_embed\": \"<string>\",\n \"generated_iframe_url\": \"<string>\",\n \"iframe_embed_code\": \"<string>\",\n \"mobile_logo_url\": \"<string>\",\n \"mobile_brand_name\": \"<string>\",\n \"mobile_brand_tagline\": \"<string>\",\n \"mobile_logo_position\": \"<string>\",\n \"mobile_brand_name_position\": \"<string>\",\n \"mobile_background_color\": \"<string>\",\n \"mobile_gradient_start_color\": \"<string>\",\n \"mobile_gradient_end_color\": \"<string>\",\n \"mobile_text_color\": \"<string>\",\n \"mobile_secondary_text_color\": \"<string>\",\n \"mobile_answer_button_color\": \"<string>\",\n \"mobile_end_button_color\": \"<string>\",\n \"mobile_slide_bar_color\": \"<string>\",\n \"mobile_slide_bar_opacity\": \"<string>\",\n \"mobile_remember_me_icon\": \"<string>\",\n \"mobile_message_icon\": \"<string>\",\n \"mobile_phone_icon\": \"<string>\",\n \"mobile_end_call_icon\": \"<string>\",\n \"mobile_remind_me_text\": \"<string>\",\n \"mobile_message_text\": \"<string>\",\n \"mobile_slide_to_answer_text\": \"<string>\",\n \"mobile_base_url_for_embed\": \"<string>\",\n \"mobile_generated_iframe_url\": \"<string>\",\n \"mobile_iframe_embed_code\": \"<string>\",\n \"orb_button_border_radius\": \"<string>\",\n \"orb_button_size\": \"<string>\",\n \"orb_blink_color\": \"<string>\",\n \"orb_icon_color\": \"<string>\",\n \"orb_icon_size\": \"<string>\",\n \"orb_button_bg_color\": \"<string>\",\n \"orb_base_url\": \"<string>\",\n \"orb_iframe_url\": \"<string>\",\n \"orb_iframe_embed_code\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Agent created successfully",
"agent_id": "agent_123456"
}Authorizations
API Key for authentication
Body
Phone number for the agent
"+1234567890"
Maximum duration for the agent in seconds
300
Temperature setting for the agent
0.7
Voice speed setting
1
Similarity setting for voice
0.75
Stability setting for voice
0.5
Background track for the agent
"background_music.mp3"
Interruption threshold in milliseconds
1000
Calendar ID for appointments
"cal_123456"
Calendar name
"Business Hours"
Pathway ID
"path_123456"
Custom tools metadata
[]
Inbound custom tools
[]
Wait for greeting setting
true
Agent questions data
[
{
"question": "What is your name?",
"questionType": "text"
}
]
Appointment agent setting
true
Task description
"Handle customer inquiries"
Knowledge base name
"customer_support"
Transfer phone number
"+1987654321"
Selected voice
"Maya"
AI model to use
"enhanced"
First sentence for the agent
"Hello, how can I help you today?"
Selected language
"en"
Agent name
"Customer Support Agent"
Store setting
true
Web agent settings
Show child attributes
Show child attributes
