curl --request POST \
--url https://api.cleartalk.ai/inbound-agents \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumber": "+1234567890",
"agentName": "Agent Name",
"task": "Task description",
"selectedVoice": "en-US-Standard-A",
"background_track": "none",
"noise_cancellation": false,
"model": "gpt-4",
"max_duration": 300,
"interruptionThreshold": 1000,
"firstSentence": "Hello!",
"selectedLanguage": "en",
"voice_settings": {
"speed": 1
},
"waitForGreeting": true,
"temperature": 0.7,
"pathwayID": "pathway-123",
"tools": [
"tool1",
"tool2"
],
"knowledgeName": "Knowledge base name",
"knowledgeBases": [
{
"name": "kb1",
"content": "content1"
}
],
"metadata": {
"key": "value"
},
"transferPhoneNumber": [
{
"transfer_type": "default",
"transfer_number": "+1234567890"
}
],
"appointmentAgent": true,
"calendarID": "cal-123",
"calendarName": "My Calendar",
"questionsData": [
{
"question": "How are you?",
"questionType": "greeting"
}
],
"customTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"inboundCustomTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"from": "+1234567890",
"block_interruptions": false,
"keywords": [
"keyword1",
"keyword2"
],
"pronunciationGuide": [
{
"word": "example",
"pronunciation": "ex-am-ple",
"case_sensitive": false,
"spaced": false
}
],
"timezone": "America/Los_Angeles",
"request_data": {
"name": "John Doe",
"age": 30
},
"start_time": "2024-03-20 12:00:00 -05:00",
"voicemail_message": "Please leave a message after the beep",
"voicemail_action": "hangup",
"retry": {
"wait": 10,
"voicemail_action": "leave_message",
"voicemail_message": "Hello, this is a test message."
},
"record": true,
"webhook_events": [
"queue",
"call",
"latency"
],
"citation_schema_id": "dcad76eb-57b6-4be6-922f-8a5a95e2ffrt",
"analysis_preset": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
"answered_by_enabled": true,
"available_tags": [
"got_full_name_and_number",
"no_information_provided"
],
"geospatial_dialing": "bd039087-decb-435a-a6e3-ca1ffbf89974",
"precall_dtmf_sequence": "1234567890*#w",
"pool_id": "#1234-5678-9012-3456",
"memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
'import requests
url = "https://api.cleartalk.ai/inbound-agents"
payload = {
"phoneNumber": "+1234567890",
"agentName": "Agent Name",
"task": "Task description",
"selectedVoice": "en-US-Standard-A",
"background_track": "none",
"noise_cancellation": False,
"model": "gpt-4",
"max_duration": 300,
"interruptionThreshold": 1000,
"firstSentence": "Hello!",
"selectedLanguage": "en",
"voice_settings": { "speed": 1 },
"waitForGreeting": True,
"temperature": 0.7,
"pathwayID": "pathway-123",
"tools": ["tool1", "tool2"],
"knowledgeName": "Knowledge base name",
"knowledgeBases": [
{
"name": "kb1",
"content": "content1"
}
],
"metadata": { "key": "value" },
"transferPhoneNumber": [
{
"transfer_type": "default",
"transfer_number": "+1234567890"
}
],
"appointmentAgent": True,
"calendarID": "cal-123",
"calendarName": "My Calendar",
"questionsData": [
{
"question": "How are you?",
"questionType": "greeting"
}
],
"customTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"inboundCustomTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"from": "+1234567890",
"block_interruptions": False,
"keywords": ["keyword1", "keyword2"],
"pronunciationGuide": [
{
"word": "example",
"pronunciation": "ex-am-ple",
"case_sensitive": False,
"spaced": False
}
],
"timezone": "America/Los_Angeles",
"request_data": {
"name": "John Doe",
"age": 30
},
"start_time": "2024-03-20 12:00:00 -05:00",
"voicemail_message": "Please leave a message after the beep",
"voicemail_action": "hangup",
"retry": {
"wait": 10,
"voicemail_action": "leave_message",
"voicemail_message": "Hello, this is a test message."
},
"record": True,
"webhook_events": ["queue", "call", "latency"],
"citation_schema_id": "dcad76eb-57b6-4be6-922f-8a5a95e2ffrt",
"analysis_preset": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
"answered_by_enabled": True,
"available_tags": ["got_full_name_and_number", "no_information_provided"],
"geospatial_dialing": "bd039087-decb-435a-a6e3-ca1ffbf89974",
"precall_dtmf_sequence": "1234567890*#w",
"pool_id": "#1234-5678-9012-3456",
"memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
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',
agentName: 'Agent Name',
task: 'Task description',
selectedVoice: 'en-US-Standard-A',
background_track: 'none',
noise_cancellation: false,
model: 'gpt-4',
max_duration: 300,
interruptionThreshold: 1000,
firstSentence: 'Hello!',
selectedLanguage: 'en',
voice_settings: {speed: 1},
waitForGreeting: true,
temperature: 0.7,
pathwayID: 'pathway-123',
tools: ['tool1', 'tool2'],
knowledgeName: 'Knowledge base name',
knowledgeBases: [{name: 'kb1', content: 'content1'}],
metadata: {key: 'value'},
transferPhoneNumber: [{transfer_type: 'default', transfer_number: '+1234567890'}],
appointmentAgent: true,
calendarID: 'cal-123',
calendarName: 'My Calendar',
questionsData: [{question: 'How are you?', questionType: 'greeting'}],
customTool: [{name: 'tool1', description: 'Tool 1 description'}],
inboundCustomTool: [{name: 'tool1', description: 'Tool 1 description'}],
from: '+1234567890',
block_interruptions: false,
keywords: ['keyword1', 'keyword2'],
pronunciationGuide: [
{
word: 'example',
pronunciation: 'ex-am-ple',
case_sensitive: false,
spaced: false
}
],
timezone: 'America/Los_Angeles',
request_data: {name: 'John Doe', age: 30},
start_time: '2024-03-20 12:00:00 -05:00',
voicemail_message: 'Please leave a message after the beep',
voicemail_action: 'hangup',
retry: {
wait: 10,
voicemail_action: 'leave_message',
voicemail_message: 'Hello, this is a test message.'
},
record: true,
webhook_events: ['queue', 'call', 'latency'],
citation_schema_id: 'dcad76eb-57b6-4be6-922f-8a5a95e2ffrt',
analysis_preset: 'a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7',
answered_by_enabled: true,
available_tags: ['got_full_name_and_number', 'no_information_provided'],
geospatial_dialing: 'bd039087-decb-435a-a6e3-ca1ffbf89974',
precall_dtmf_sequence: '1234567890*#w',
pool_id: '#1234-5678-9012-3456',
memory_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
})
};
fetch('https://api.cleartalk.ai/inbound-agents', 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/inbound-agents",
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',
'agentName' => 'Agent Name',
'task' => 'Task description',
'selectedVoice' => 'en-US-Standard-A',
'background_track' => 'none',
'noise_cancellation' => false,
'model' => 'gpt-4',
'max_duration' => 300,
'interruptionThreshold' => 1000,
'firstSentence' => 'Hello!',
'selectedLanguage' => 'en',
'voice_settings' => [
'speed' => 1
],
'waitForGreeting' => true,
'temperature' => 0.7,
'pathwayID' => 'pathway-123',
'tools' => [
'tool1',
'tool2'
],
'knowledgeName' => 'Knowledge base name',
'knowledgeBases' => [
[
'name' => 'kb1',
'content' => 'content1'
]
],
'metadata' => [
'key' => 'value'
],
'transferPhoneNumber' => [
[
'transfer_type' => 'default',
'transfer_number' => '+1234567890'
]
],
'appointmentAgent' => true,
'calendarID' => 'cal-123',
'calendarName' => 'My Calendar',
'questionsData' => [
[
'question' => 'How are you?',
'questionType' => 'greeting'
]
],
'customTool' => [
[
'name' => 'tool1',
'description' => 'Tool 1 description'
]
],
'inboundCustomTool' => [
[
'name' => 'tool1',
'description' => 'Tool 1 description'
]
],
'from' => '+1234567890',
'block_interruptions' => false,
'keywords' => [
'keyword1',
'keyword2'
],
'pronunciationGuide' => [
[
'word' => 'example',
'pronunciation' => 'ex-am-ple',
'case_sensitive' => false,
'spaced' => false
]
],
'timezone' => 'America/Los_Angeles',
'request_data' => [
'name' => 'John Doe',
'age' => 30
],
'start_time' => '2024-03-20 12:00:00 -05:00',
'voicemail_message' => 'Please leave a message after the beep',
'voicemail_action' => 'hangup',
'retry' => [
'wait' => 10,
'voicemail_action' => 'leave_message',
'voicemail_message' => 'Hello, this is a test message.'
],
'record' => true,
'webhook_events' => [
'queue',
'call',
'latency'
],
'citation_schema_id' => 'dcad76eb-57b6-4be6-922f-8a5a95e2ffrt',
'analysis_preset' => 'a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7',
'answered_by_enabled' => true,
'available_tags' => [
'got_full_name_and_number',
'no_information_provided'
],
'geospatial_dialing' => 'bd039087-decb-435a-a6e3-ca1ffbf89974',
'precall_dtmf_sequence' => '1234567890*#w',
'pool_id' => '#1234-5678-9012-3456',
'memory_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
]),
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/inbound-agents"
payload := strings.NewReader("{\n \"phoneNumber\": \"+1234567890\",\n \"agentName\": \"Agent Name\",\n \"task\": \"Task description\",\n \"selectedVoice\": \"en-US-Standard-A\",\n \"background_track\": \"none\",\n \"noise_cancellation\": false,\n \"model\": \"gpt-4\",\n \"max_duration\": 300,\n \"interruptionThreshold\": 1000,\n \"firstSentence\": \"Hello!\",\n \"selectedLanguage\": \"en\",\n \"voice_settings\": {\n \"speed\": 1\n },\n \"waitForGreeting\": true,\n \"temperature\": 0.7,\n \"pathwayID\": \"pathway-123\",\n \"tools\": [\n \"tool1\",\n \"tool2\"\n ],\n \"knowledgeName\": \"Knowledge base name\",\n \"knowledgeBases\": [\n {\n \"name\": \"kb1\",\n \"content\": \"content1\"\n }\n ],\n \"metadata\": {\n \"key\": \"value\"\n },\n \"transferPhoneNumber\": [\n {\n \"transfer_type\": \"default\",\n \"transfer_number\": \"+1234567890\"\n }\n ],\n \"appointmentAgent\": true,\n \"calendarID\": \"cal-123\",\n \"calendarName\": \"My Calendar\",\n \"questionsData\": [\n {\n \"question\": \"How are you?\",\n \"questionType\": \"greeting\"\n }\n ],\n \"customTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"inboundCustomTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"from\": \"+1234567890\",\n \"block_interruptions\": false,\n \"keywords\": [\n \"keyword1\",\n \"keyword2\"\n ],\n \"pronunciationGuide\": [\n {\n \"word\": \"example\",\n \"pronunciation\": \"ex-am-ple\",\n \"case_sensitive\": false,\n \"spaced\": false\n }\n ],\n \"timezone\": \"America/Los_Angeles\",\n \"request_data\": {\n \"name\": \"John Doe\",\n \"age\": 30\n },\n \"start_time\": \"2024-03-20 12:00:00 -05:00\",\n \"voicemail_message\": \"Please leave a message after the beep\",\n \"voicemail_action\": \"hangup\",\n \"retry\": {\n \"wait\": 10,\n \"voicemail_action\": \"leave_message\",\n \"voicemail_message\": \"Hello, this is a test message.\"\n },\n \"record\": true,\n \"webhook_events\": [\n \"queue\",\n \"call\",\n \"latency\"\n ],\n \"citation_schema_id\": \"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt\",\n \"analysis_preset\": \"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7\",\n \"answered_by_enabled\": true,\n \"available_tags\": [\n \"got_full_name_and_number\",\n \"no_information_provided\"\n ],\n \"geospatial_dialing\": \"bd039087-decb-435a-a6e3-ca1ffbf89974\",\n \"precall_dtmf_sequence\": \"1234567890*#w\",\n \"pool_id\": \"#1234-5678-9012-3456\",\n \"memory_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\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/inbound-agents")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+1234567890\",\n \"agentName\": \"Agent Name\",\n \"task\": \"Task description\",\n \"selectedVoice\": \"en-US-Standard-A\",\n \"background_track\": \"none\",\n \"noise_cancellation\": false,\n \"model\": \"gpt-4\",\n \"max_duration\": 300,\n \"interruptionThreshold\": 1000,\n \"firstSentence\": \"Hello!\",\n \"selectedLanguage\": \"en\",\n \"voice_settings\": {\n \"speed\": 1\n },\n \"waitForGreeting\": true,\n \"temperature\": 0.7,\n \"pathwayID\": \"pathway-123\",\n \"tools\": [\n \"tool1\",\n \"tool2\"\n ],\n \"knowledgeName\": \"Knowledge base name\",\n \"knowledgeBases\": [\n {\n \"name\": \"kb1\",\n \"content\": \"content1\"\n }\n ],\n \"metadata\": {\n \"key\": \"value\"\n },\n \"transferPhoneNumber\": [\n {\n \"transfer_type\": \"default\",\n \"transfer_number\": \"+1234567890\"\n }\n ],\n \"appointmentAgent\": true,\n \"calendarID\": \"cal-123\",\n \"calendarName\": \"My Calendar\",\n \"questionsData\": [\n {\n \"question\": \"How are you?\",\n \"questionType\": \"greeting\"\n }\n ],\n \"customTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"inboundCustomTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"from\": \"+1234567890\",\n \"block_interruptions\": false,\n \"keywords\": [\n \"keyword1\",\n \"keyword2\"\n ],\n \"pronunciationGuide\": [\n {\n \"word\": \"example\",\n \"pronunciation\": \"ex-am-ple\",\n \"case_sensitive\": false,\n \"spaced\": false\n }\n ],\n \"timezone\": \"America/Los_Angeles\",\n \"request_data\": {\n \"name\": \"John Doe\",\n \"age\": 30\n },\n \"start_time\": \"2024-03-20 12:00:00 -05:00\",\n \"voicemail_message\": \"Please leave a message after the beep\",\n \"voicemail_action\": \"hangup\",\n \"retry\": {\n \"wait\": 10,\n \"voicemail_action\": \"leave_message\",\n \"voicemail_message\": \"Hello, this is a test message.\"\n },\n \"record\": true,\n \"webhook_events\": [\n \"queue\",\n \"call\",\n \"latency\"\n ],\n \"citation_schema_id\": \"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt\",\n \"analysis_preset\": \"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7\",\n \"answered_by_enabled\": true,\n \"available_tags\": [\n \"got_full_name_and_number\",\n \"no_information_provided\"\n ],\n \"geospatial_dialing\": \"bd039087-decb-435a-a6e3-ca1ffbf89974\",\n \"precall_dtmf_sequence\": \"1234567890*#w\",\n \"pool_id\": \"#1234-5678-9012-3456\",\n \"memory_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/inbound-agents")
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 \"agentName\": \"Agent Name\",\n \"task\": \"Task description\",\n \"selectedVoice\": \"en-US-Standard-A\",\n \"background_track\": \"none\",\n \"noise_cancellation\": false,\n \"model\": \"gpt-4\",\n \"max_duration\": 300,\n \"interruptionThreshold\": 1000,\n \"firstSentence\": \"Hello!\",\n \"selectedLanguage\": \"en\",\n \"voice_settings\": {\n \"speed\": 1\n },\n \"waitForGreeting\": true,\n \"temperature\": 0.7,\n \"pathwayID\": \"pathway-123\",\n \"tools\": [\n \"tool1\",\n \"tool2\"\n ],\n \"knowledgeName\": \"Knowledge base name\",\n \"knowledgeBases\": [\n {\n \"name\": \"kb1\",\n \"content\": \"content1\"\n }\n ],\n \"metadata\": {\n \"key\": \"value\"\n },\n \"transferPhoneNumber\": [\n {\n \"transfer_type\": \"default\",\n \"transfer_number\": \"+1234567890\"\n }\n ],\n \"appointmentAgent\": true,\n \"calendarID\": \"cal-123\",\n \"calendarName\": \"My Calendar\",\n \"questionsData\": [\n {\n \"question\": \"How are you?\",\n \"questionType\": \"greeting\"\n }\n ],\n \"customTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"inboundCustomTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"from\": \"+1234567890\",\n \"block_interruptions\": false,\n \"keywords\": [\n \"keyword1\",\n \"keyword2\"\n ],\n \"pronunciationGuide\": [\n {\n \"word\": \"example\",\n \"pronunciation\": \"ex-am-ple\",\n \"case_sensitive\": false,\n \"spaced\": false\n }\n ],\n \"timezone\": \"America/Los_Angeles\",\n \"request_data\": {\n \"name\": \"John Doe\",\n \"age\": 30\n },\n \"start_time\": \"2024-03-20 12:00:00 -05:00\",\n \"voicemail_message\": \"Please leave a message after the beep\",\n \"voicemail_action\": \"hangup\",\n \"retry\": {\n \"wait\": 10,\n \"voicemail_action\": \"leave_message\",\n \"voicemail_message\": \"Hello, this is a test message.\"\n },\n \"record\": true,\n \"webhook_events\": [\n \"queue\",\n \"call\",\n \"latency\"\n ],\n \"citation_schema_id\": \"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt\",\n \"analysis_preset\": \"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7\",\n \"answered_by_enabled\": true,\n \"available_tags\": [\n \"got_full_name_and_number\",\n \"no_information_provided\"\n ],\n \"geospatial_dialing\": \"bd039087-decb-435a-a6e3-ca1ffbf89974\",\n \"precall_dtmf_sequence\": \"1234567890*#w\",\n \"pool_id\": \"#1234-5678-9012-3456\",\n \"memory_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n}"
response = http.request(request)
puts response.read_bodyCreate a new inbound agent
curl --request POST \
--url https://api.cleartalk.ai/inbound-agents \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumber": "+1234567890",
"agentName": "Agent Name",
"task": "Task description",
"selectedVoice": "en-US-Standard-A",
"background_track": "none",
"noise_cancellation": false,
"model": "gpt-4",
"max_duration": 300,
"interruptionThreshold": 1000,
"firstSentence": "Hello!",
"selectedLanguage": "en",
"voice_settings": {
"speed": 1
},
"waitForGreeting": true,
"temperature": 0.7,
"pathwayID": "pathway-123",
"tools": [
"tool1",
"tool2"
],
"knowledgeName": "Knowledge base name",
"knowledgeBases": [
{
"name": "kb1",
"content": "content1"
}
],
"metadata": {
"key": "value"
},
"transferPhoneNumber": [
{
"transfer_type": "default",
"transfer_number": "+1234567890"
}
],
"appointmentAgent": true,
"calendarID": "cal-123",
"calendarName": "My Calendar",
"questionsData": [
{
"question": "How are you?",
"questionType": "greeting"
}
],
"customTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"inboundCustomTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"from": "+1234567890",
"block_interruptions": false,
"keywords": [
"keyword1",
"keyword2"
],
"pronunciationGuide": [
{
"word": "example",
"pronunciation": "ex-am-ple",
"case_sensitive": false,
"spaced": false
}
],
"timezone": "America/Los_Angeles",
"request_data": {
"name": "John Doe",
"age": 30
},
"start_time": "2024-03-20 12:00:00 -05:00",
"voicemail_message": "Please leave a message after the beep",
"voicemail_action": "hangup",
"retry": {
"wait": 10,
"voicemail_action": "leave_message",
"voicemail_message": "Hello, this is a test message."
},
"record": true,
"webhook_events": [
"queue",
"call",
"latency"
],
"citation_schema_id": "dcad76eb-57b6-4be6-922f-8a5a95e2ffrt",
"analysis_preset": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
"answered_by_enabled": true,
"available_tags": [
"got_full_name_and_number",
"no_information_provided"
],
"geospatial_dialing": "bd039087-decb-435a-a6e3-ca1ffbf89974",
"precall_dtmf_sequence": "1234567890*#w",
"pool_id": "#1234-5678-9012-3456",
"memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
'import requests
url = "https://api.cleartalk.ai/inbound-agents"
payload = {
"phoneNumber": "+1234567890",
"agentName": "Agent Name",
"task": "Task description",
"selectedVoice": "en-US-Standard-A",
"background_track": "none",
"noise_cancellation": False,
"model": "gpt-4",
"max_duration": 300,
"interruptionThreshold": 1000,
"firstSentence": "Hello!",
"selectedLanguage": "en",
"voice_settings": { "speed": 1 },
"waitForGreeting": True,
"temperature": 0.7,
"pathwayID": "pathway-123",
"tools": ["tool1", "tool2"],
"knowledgeName": "Knowledge base name",
"knowledgeBases": [
{
"name": "kb1",
"content": "content1"
}
],
"metadata": { "key": "value" },
"transferPhoneNumber": [
{
"transfer_type": "default",
"transfer_number": "+1234567890"
}
],
"appointmentAgent": True,
"calendarID": "cal-123",
"calendarName": "My Calendar",
"questionsData": [
{
"question": "How are you?",
"questionType": "greeting"
}
],
"customTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"inboundCustomTool": [
{
"name": "tool1",
"description": "Tool 1 description"
}
],
"from": "+1234567890",
"block_interruptions": False,
"keywords": ["keyword1", "keyword2"],
"pronunciationGuide": [
{
"word": "example",
"pronunciation": "ex-am-ple",
"case_sensitive": False,
"spaced": False
}
],
"timezone": "America/Los_Angeles",
"request_data": {
"name": "John Doe",
"age": 30
},
"start_time": "2024-03-20 12:00:00 -05:00",
"voicemail_message": "Please leave a message after the beep",
"voicemail_action": "hangup",
"retry": {
"wait": 10,
"voicemail_action": "leave_message",
"voicemail_message": "Hello, this is a test message."
},
"record": True,
"webhook_events": ["queue", "call", "latency"],
"citation_schema_id": "dcad76eb-57b6-4be6-922f-8a5a95e2ffrt",
"analysis_preset": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
"answered_by_enabled": True,
"available_tags": ["got_full_name_and_number", "no_information_provided"],
"geospatial_dialing": "bd039087-decb-435a-a6e3-ca1ffbf89974",
"precall_dtmf_sequence": "1234567890*#w",
"pool_id": "#1234-5678-9012-3456",
"memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
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',
agentName: 'Agent Name',
task: 'Task description',
selectedVoice: 'en-US-Standard-A',
background_track: 'none',
noise_cancellation: false,
model: 'gpt-4',
max_duration: 300,
interruptionThreshold: 1000,
firstSentence: 'Hello!',
selectedLanguage: 'en',
voice_settings: {speed: 1},
waitForGreeting: true,
temperature: 0.7,
pathwayID: 'pathway-123',
tools: ['tool1', 'tool2'],
knowledgeName: 'Knowledge base name',
knowledgeBases: [{name: 'kb1', content: 'content1'}],
metadata: {key: 'value'},
transferPhoneNumber: [{transfer_type: 'default', transfer_number: '+1234567890'}],
appointmentAgent: true,
calendarID: 'cal-123',
calendarName: 'My Calendar',
questionsData: [{question: 'How are you?', questionType: 'greeting'}],
customTool: [{name: 'tool1', description: 'Tool 1 description'}],
inboundCustomTool: [{name: 'tool1', description: 'Tool 1 description'}],
from: '+1234567890',
block_interruptions: false,
keywords: ['keyword1', 'keyword2'],
pronunciationGuide: [
{
word: 'example',
pronunciation: 'ex-am-ple',
case_sensitive: false,
spaced: false
}
],
timezone: 'America/Los_Angeles',
request_data: {name: 'John Doe', age: 30},
start_time: '2024-03-20 12:00:00 -05:00',
voicemail_message: 'Please leave a message after the beep',
voicemail_action: 'hangup',
retry: {
wait: 10,
voicemail_action: 'leave_message',
voicemail_message: 'Hello, this is a test message.'
},
record: true,
webhook_events: ['queue', 'call', 'latency'],
citation_schema_id: 'dcad76eb-57b6-4be6-922f-8a5a95e2ffrt',
analysis_preset: 'a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7',
answered_by_enabled: true,
available_tags: ['got_full_name_and_number', 'no_information_provided'],
geospatial_dialing: 'bd039087-decb-435a-a6e3-ca1ffbf89974',
precall_dtmf_sequence: '1234567890*#w',
pool_id: '#1234-5678-9012-3456',
memory_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
})
};
fetch('https://api.cleartalk.ai/inbound-agents', 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/inbound-agents",
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',
'agentName' => 'Agent Name',
'task' => 'Task description',
'selectedVoice' => 'en-US-Standard-A',
'background_track' => 'none',
'noise_cancellation' => false,
'model' => 'gpt-4',
'max_duration' => 300,
'interruptionThreshold' => 1000,
'firstSentence' => 'Hello!',
'selectedLanguage' => 'en',
'voice_settings' => [
'speed' => 1
],
'waitForGreeting' => true,
'temperature' => 0.7,
'pathwayID' => 'pathway-123',
'tools' => [
'tool1',
'tool2'
],
'knowledgeName' => 'Knowledge base name',
'knowledgeBases' => [
[
'name' => 'kb1',
'content' => 'content1'
]
],
'metadata' => [
'key' => 'value'
],
'transferPhoneNumber' => [
[
'transfer_type' => 'default',
'transfer_number' => '+1234567890'
]
],
'appointmentAgent' => true,
'calendarID' => 'cal-123',
'calendarName' => 'My Calendar',
'questionsData' => [
[
'question' => 'How are you?',
'questionType' => 'greeting'
]
],
'customTool' => [
[
'name' => 'tool1',
'description' => 'Tool 1 description'
]
],
'inboundCustomTool' => [
[
'name' => 'tool1',
'description' => 'Tool 1 description'
]
],
'from' => '+1234567890',
'block_interruptions' => false,
'keywords' => [
'keyword1',
'keyword2'
],
'pronunciationGuide' => [
[
'word' => 'example',
'pronunciation' => 'ex-am-ple',
'case_sensitive' => false,
'spaced' => false
]
],
'timezone' => 'America/Los_Angeles',
'request_data' => [
'name' => 'John Doe',
'age' => 30
],
'start_time' => '2024-03-20 12:00:00 -05:00',
'voicemail_message' => 'Please leave a message after the beep',
'voicemail_action' => 'hangup',
'retry' => [
'wait' => 10,
'voicemail_action' => 'leave_message',
'voicemail_message' => 'Hello, this is a test message.'
],
'record' => true,
'webhook_events' => [
'queue',
'call',
'latency'
],
'citation_schema_id' => 'dcad76eb-57b6-4be6-922f-8a5a95e2ffrt',
'analysis_preset' => 'a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7',
'answered_by_enabled' => true,
'available_tags' => [
'got_full_name_and_number',
'no_information_provided'
],
'geospatial_dialing' => 'bd039087-decb-435a-a6e3-ca1ffbf89974',
'precall_dtmf_sequence' => '1234567890*#w',
'pool_id' => '#1234-5678-9012-3456',
'memory_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
]),
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/inbound-agents"
payload := strings.NewReader("{\n \"phoneNumber\": \"+1234567890\",\n \"agentName\": \"Agent Name\",\n \"task\": \"Task description\",\n \"selectedVoice\": \"en-US-Standard-A\",\n \"background_track\": \"none\",\n \"noise_cancellation\": false,\n \"model\": \"gpt-4\",\n \"max_duration\": 300,\n \"interruptionThreshold\": 1000,\n \"firstSentence\": \"Hello!\",\n \"selectedLanguage\": \"en\",\n \"voice_settings\": {\n \"speed\": 1\n },\n \"waitForGreeting\": true,\n \"temperature\": 0.7,\n \"pathwayID\": \"pathway-123\",\n \"tools\": [\n \"tool1\",\n \"tool2\"\n ],\n \"knowledgeName\": \"Knowledge base name\",\n \"knowledgeBases\": [\n {\n \"name\": \"kb1\",\n \"content\": \"content1\"\n }\n ],\n \"metadata\": {\n \"key\": \"value\"\n },\n \"transferPhoneNumber\": [\n {\n \"transfer_type\": \"default\",\n \"transfer_number\": \"+1234567890\"\n }\n ],\n \"appointmentAgent\": true,\n \"calendarID\": \"cal-123\",\n \"calendarName\": \"My Calendar\",\n \"questionsData\": [\n {\n \"question\": \"How are you?\",\n \"questionType\": \"greeting\"\n }\n ],\n \"customTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"inboundCustomTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"from\": \"+1234567890\",\n \"block_interruptions\": false,\n \"keywords\": [\n \"keyword1\",\n \"keyword2\"\n ],\n \"pronunciationGuide\": [\n {\n \"word\": \"example\",\n \"pronunciation\": \"ex-am-ple\",\n \"case_sensitive\": false,\n \"spaced\": false\n }\n ],\n \"timezone\": \"America/Los_Angeles\",\n \"request_data\": {\n \"name\": \"John Doe\",\n \"age\": 30\n },\n \"start_time\": \"2024-03-20 12:00:00 -05:00\",\n \"voicemail_message\": \"Please leave a message after the beep\",\n \"voicemail_action\": \"hangup\",\n \"retry\": {\n \"wait\": 10,\n \"voicemail_action\": \"leave_message\",\n \"voicemail_message\": \"Hello, this is a test message.\"\n },\n \"record\": true,\n \"webhook_events\": [\n \"queue\",\n \"call\",\n \"latency\"\n ],\n \"citation_schema_id\": \"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt\",\n \"analysis_preset\": \"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7\",\n \"answered_by_enabled\": true,\n \"available_tags\": [\n \"got_full_name_and_number\",\n \"no_information_provided\"\n ],\n \"geospatial_dialing\": \"bd039087-decb-435a-a6e3-ca1ffbf89974\",\n \"precall_dtmf_sequence\": \"1234567890*#w\",\n \"pool_id\": \"#1234-5678-9012-3456\",\n \"memory_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\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/inbound-agents")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+1234567890\",\n \"agentName\": \"Agent Name\",\n \"task\": \"Task description\",\n \"selectedVoice\": \"en-US-Standard-A\",\n \"background_track\": \"none\",\n \"noise_cancellation\": false,\n \"model\": \"gpt-4\",\n \"max_duration\": 300,\n \"interruptionThreshold\": 1000,\n \"firstSentence\": \"Hello!\",\n \"selectedLanguage\": \"en\",\n \"voice_settings\": {\n \"speed\": 1\n },\n \"waitForGreeting\": true,\n \"temperature\": 0.7,\n \"pathwayID\": \"pathway-123\",\n \"tools\": [\n \"tool1\",\n \"tool2\"\n ],\n \"knowledgeName\": \"Knowledge base name\",\n \"knowledgeBases\": [\n {\n \"name\": \"kb1\",\n \"content\": \"content1\"\n }\n ],\n \"metadata\": {\n \"key\": \"value\"\n },\n \"transferPhoneNumber\": [\n {\n \"transfer_type\": \"default\",\n \"transfer_number\": \"+1234567890\"\n }\n ],\n \"appointmentAgent\": true,\n \"calendarID\": \"cal-123\",\n \"calendarName\": \"My Calendar\",\n \"questionsData\": [\n {\n \"question\": \"How are you?\",\n \"questionType\": \"greeting\"\n }\n ],\n \"customTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"inboundCustomTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"from\": \"+1234567890\",\n \"block_interruptions\": false,\n \"keywords\": [\n \"keyword1\",\n \"keyword2\"\n ],\n \"pronunciationGuide\": [\n {\n \"word\": \"example\",\n \"pronunciation\": \"ex-am-ple\",\n \"case_sensitive\": false,\n \"spaced\": false\n }\n ],\n \"timezone\": \"America/Los_Angeles\",\n \"request_data\": {\n \"name\": \"John Doe\",\n \"age\": 30\n },\n \"start_time\": \"2024-03-20 12:00:00 -05:00\",\n \"voicemail_message\": \"Please leave a message after the beep\",\n \"voicemail_action\": \"hangup\",\n \"retry\": {\n \"wait\": 10,\n \"voicemail_action\": \"leave_message\",\n \"voicemail_message\": \"Hello, this is a test message.\"\n },\n \"record\": true,\n \"webhook_events\": [\n \"queue\",\n \"call\",\n \"latency\"\n ],\n \"citation_schema_id\": \"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt\",\n \"analysis_preset\": \"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7\",\n \"answered_by_enabled\": true,\n \"available_tags\": [\n \"got_full_name_and_number\",\n \"no_information_provided\"\n ],\n \"geospatial_dialing\": \"bd039087-decb-435a-a6e3-ca1ffbf89974\",\n \"precall_dtmf_sequence\": \"1234567890*#w\",\n \"pool_id\": \"#1234-5678-9012-3456\",\n \"memory_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleartalk.ai/inbound-agents")
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 \"agentName\": \"Agent Name\",\n \"task\": \"Task description\",\n \"selectedVoice\": \"en-US-Standard-A\",\n \"background_track\": \"none\",\n \"noise_cancellation\": false,\n \"model\": \"gpt-4\",\n \"max_duration\": 300,\n \"interruptionThreshold\": 1000,\n \"firstSentence\": \"Hello!\",\n \"selectedLanguage\": \"en\",\n \"voice_settings\": {\n \"speed\": 1\n },\n \"waitForGreeting\": true,\n \"temperature\": 0.7,\n \"pathwayID\": \"pathway-123\",\n \"tools\": [\n \"tool1\",\n \"tool2\"\n ],\n \"knowledgeName\": \"Knowledge base name\",\n \"knowledgeBases\": [\n {\n \"name\": \"kb1\",\n \"content\": \"content1\"\n }\n ],\n \"metadata\": {\n \"key\": \"value\"\n },\n \"transferPhoneNumber\": [\n {\n \"transfer_type\": \"default\",\n \"transfer_number\": \"+1234567890\"\n }\n ],\n \"appointmentAgent\": true,\n \"calendarID\": \"cal-123\",\n \"calendarName\": \"My Calendar\",\n \"questionsData\": [\n {\n \"question\": \"How are you?\",\n \"questionType\": \"greeting\"\n }\n ],\n \"customTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"inboundCustomTool\": [\n {\n \"name\": \"tool1\",\n \"description\": \"Tool 1 description\"\n }\n ],\n \"from\": \"+1234567890\",\n \"block_interruptions\": false,\n \"keywords\": [\n \"keyword1\",\n \"keyword2\"\n ],\n \"pronunciationGuide\": [\n {\n \"word\": \"example\",\n \"pronunciation\": \"ex-am-ple\",\n \"case_sensitive\": false,\n \"spaced\": false\n }\n ],\n \"timezone\": \"America/Los_Angeles\",\n \"request_data\": {\n \"name\": \"John Doe\",\n \"age\": 30\n },\n \"start_time\": \"2024-03-20 12:00:00 -05:00\",\n \"voicemail_message\": \"Please leave a message after the beep\",\n \"voicemail_action\": \"hangup\",\n \"retry\": {\n \"wait\": 10,\n \"voicemail_action\": \"leave_message\",\n \"voicemail_message\": \"Hello, this is a test message.\"\n },\n \"record\": true,\n \"webhook_events\": [\n \"queue\",\n \"call\",\n \"latency\"\n ],\n \"citation_schema_id\": \"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt\",\n \"analysis_preset\": \"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7\",\n \"answered_by_enabled\": true,\n \"available_tags\": [\n \"got_full_name_and_number\",\n \"no_information_provided\"\n ],\n \"geospatial_dialing\": \"bd039087-decb-435a-a6e3-ca1ffbf89974\",\n \"precall_dtmf_sequence\": \"1234567890*#w\",\n \"pool_id\": \"#1234-5678-9012-3456\",\n \"memory_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
API Key for authentication
Body
Phone number for the inbound agent
"+1234567890"
Name of the agent
"Agent Name"
Task or prompt for the agent
"Task description"
Voice for the agent
"en-US-Standard-A"
Background track for the agent
"none"
Whether to enable noise cancellation
false
AI model to use
"gpt-4"
Maximum duration in seconds
300
Interruption threshold
1000
First sentence to say
"Hello!"
Language for the agent
"en"
Voice settings
Show child attributes
Show child attributes
{ "speed": 1 }
Whether to wait for greeting
true
Temperature for AI responses
0.7
Pathway ID
"pathway-123"
Tools to use
["tool1", "tool2"]
Name of the knowledge base
"Knowledge base name"
Knowledge base data
[{ "name": "kb1", "content": "content1" }]
Additional metadata
{ "key": "value" }
Transfer phone numbers
Show child attributes
Show child attributes
[
{
"transfer_type": "default",
"transfer_number": "+1234567890"
}
]
Whether this is an appointment agent
true
Calendar ID
"cal-123"
Calendar name
"My Calendar"
Questions for the agent
Show child attributes
Show child attributes
[
{
"question": "How are you?",
"questionType": "greeting"
}
]
Custom tools
[
{
"name": "tool1",
"description": "Tool 1 description"
}
]
Custom tools
[
{
"name": "tool1",
"description": "Tool 1 description"
}
]
Phone number to call from
"+1234567890"
Whether to block interruptions
false
Keywords to boost in transcription
["keyword1", "keyword2"]
Pronunciation guide for specific words
[
{
"word": "example",
"pronunciation": "ex-am-ple",
"case_sensitive": false,
"spaced": false
}
]
Timezone for the call
"America/Los_Angeles"
Request data available to the AI agent during the call
{ "name": "John Doe", "age": 30 }
Scheduled start time for the call
"2024-03-20 12:00:00 -05:00"
Message to leave on voicemail
"Please leave a message after the beep"
Action to take when voicemail is detected
hangup, leave_message, ignore "hangup"
Retry configuration for voicemail calls
Show child attributes
Show child attributes
{
"wait": 10,
"voicemail_action": "leave_message",
"voicemail_message": "Hello, this is a test message."
}
Whether to record the call
true
Events to stream to webhook
["queue", "call", "latency"]
Citation schema ID for post-call analysis
"dcad76eb-57b6-4be6-922f-8a5a95e2ffrt"
Analysis preset UUID
"a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7"
Whether to enable answered-by detection
true
Available disposition tags
[
"got_full_name_and_number",
"no_information_provided"
]
Geospatial dialing pool UUID
"bd039087-decb-435a-a6e3-ca1ffbf89974"
DTMF sequence to play before call starts
"1234567890*#w"
Pool ID
"#1234-5678-9012-3456"
UUID of the memory to associate with this agent
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Webhook configuration
Show child attributes
Show child attributes
Get data configuration
Show child attributes
Show child attributes
Response
Agent created successfully
