Create Voice AI Agent
curl --request POST \
--url https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"model": "<string>",
"api_keys": [
{
"api_key_id": 123,
"type": "<string>"
}
],
"instructions": "<string>",
"prompts": {
"agent": "<string>",
"goal": "<string>"
},
"phone_number": "<string>",
"incoming_call_greeting": "<string>",
"outgoing_call_greeting": "<string>",
"synthesizer": "<string>",
"voice_id": "<string>",
"language": "<string>",
"enable_recordings": true,
"behaviour": {
"speed": "<string>",
"emotions": {
"anger": "<string>",
"curiosity": "<string>",
"positivity": "<string>",
"surprise": "<string>",
"sadness": "<string>"
}
},
"kb_id": "<string>",
"additional_settings": {
"Synthesizer": {
"Azure": {
"voice_name": "<string>",
"rate": "<string>",
"language_code": "<string>"
},
"Cartesia": {
"speed": "<string>",
"emotion": {}
},
"ElevenLabs": {
"stability": "<string>",
"style_exaggeration": "<string>",
"similarity": "<string>",
"optimize_latency": "<string>"
}
},
"Transcriber": {
"Deepgram": {
"language": "<string>",
"keywords": [
"<string>"
]
}
},
"Agent": {
"OpenAI": {
"temperature": 123,
"max_tokens": 123,
"backchannel_probability": 123
},
"model": "<string>",
"temperature": 123,
"max_tokens": 123,
"allow_incoming_messages": true,
"time_zone": "<string>",
"initial_message": "<string>",
"initial_message_delay": 123,
"interrupt_sensitivity": "<string>",
"max_call_duration": 123,
"end_conversation_on_goodbye": true,
"goodbye_phrases": [
"<string>"
],
"reminder": {
"allowed_idle_time_seconds": 123,
"num_check_human_present_times": 123,
"reminder_messages": [
"<string>"
],
"message_before_termination": "<string>"
}
},
"SynthesizerUsed": "<string>",
"TranscriberUsed": "<string>",
"AgentUsed": "<string>",
"save_transcripts": true,
"enable_voicemail_detection": true,
"voicemail_message": "<string>",
"check_idle_time": true
},
"action_ids": [
"<string>"
],
"response_time": 123,
"version": "<string>"
}
'import requests
url = "https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants"
payload = {
"name": "<string>",
"type": "<string>",
"model": "<string>",
"api_keys": [
{
"api_key_id": 123,
"type": "<string>"
}
],
"instructions": "<string>",
"prompts": {
"agent": "<string>",
"goal": "<string>"
},
"phone_number": "<string>",
"incoming_call_greeting": "<string>",
"outgoing_call_greeting": "<string>",
"synthesizer": "<string>",
"voice_id": "<string>",
"language": "<string>",
"enable_recordings": True,
"behaviour": {
"speed": "<string>",
"emotions": {
"anger": "<string>",
"curiosity": "<string>",
"positivity": "<string>",
"surprise": "<string>",
"sadness": "<string>"
}
},
"kb_id": "<string>",
"additional_settings": {
"Synthesizer": {
"Azure": {
"voice_name": "<string>",
"rate": "<string>",
"language_code": "<string>"
},
"Cartesia": {
"speed": "<string>",
"emotion": {}
},
"ElevenLabs": {
"stability": "<string>",
"style_exaggeration": "<string>",
"similarity": "<string>",
"optimize_latency": "<string>"
}
},
"Transcriber": { "Deepgram": {
"language": "<string>",
"keywords": ["<string>"]
} },
"Agent": {
"OpenAI": {
"temperature": 123,
"max_tokens": 123,
"backchannel_probability": 123
},
"model": "<string>",
"temperature": 123,
"max_tokens": 123,
"allow_incoming_messages": True,
"time_zone": "<string>",
"initial_message": "<string>",
"initial_message_delay": 123,
"interrupt_sensitivity": "<string>",
"max_call_duration": 123,
"end_conversation_on_goodbye": True,
"goodbye_phrases": ["<string>"],
"reminder": {
"allowed_idle_time_seconds": 123,
"num_check_human_present_times": 123,
"reminder_messages": ["<string>"],
"message_before_termination": "<string>"
}
},
"SynthesizerUsed": "<string>",
"TranscriberUsed": "<string>",
"AgentUsed": "<string>",
"save_transcripts": True,
"enable_voicemail_detection": True,
"voicemail_message": "<string>",
"check_idle_time": True
},
"action_ids": ["<string>"],
"response_time": 123,
"version": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
model: '<string>',
api_keys: [{api_key_id: 123, type: '<string>'}],
instructions: '<string>',
prompts: {agent: '<string>', goal: '<string>'},
phone_number: '<string>',
incoming_call_greeting: '<string>',
outgoing_call_greeting: '<string>',
synthesizer: '<string>',
voice_id: '<string>',
language: '<string>',
enable_recordings: true,
behaviour: {
speed: '<string>',
emotions: {
anger: '<string>',
curiosity: '<string>',
positivity: '<string>',
surprise: '<string>',
sadness: '<string>'
}
},
kb_id: '<string>',
additional_settings: {
Synthesizer: {
Azure: {voice_name: '<string>', rate: '<string>', language_code: '<string>'},
Cartesia: {speed: '<string>', emotion: {}},
ElevenLabs: {
stability: '<string>',
style_exaggeration: '<string>',
similarity: '<string>',
optimize_latency: '<string>'
}
},
Transcriber: {Deepgram: {language: '<string>', keywords: ['<string>']}},
Agent: {
OpenAI: {temperature: 123, max_tokens: 123, backchannel_probability: 123},
model: '<string>',
temperature: 123,
max_tokens: 123,
allow_incoming_messages: true,
time_zone: '<string>',
initial_message: '<string>',
initial_message_delay: 123,
interrupt_sensitivity: '<string>',
max_call_duration: 123,
end_conversation_on_goodbye: true,
goodbye_phrases: ['<string>'],
reminder: {
allowed_idle_time_seconds: 123,
num_check_human_present_times: 123,
reminder_messages: ['<string>'],
message_before_termination: '<string>'
}
},
SynthesizerUsed: '<string>',
TranscriberUsed: '<string>',
AgentUsed: '<string>',
save_transcripts: true,
enable_voicemail_detection: true,
voicemail_message: '<string>',
check_idle_time: true
},
action_ids: ['<string>'],
response_time: 123,
version: '<string>'
})
};
fetch('https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants', 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://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants",
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>',
'type' => '<string>',
'model' => '<string>',
'api_keys' => [
[
'api_key_id' => 123,
'type' => '<string>'
]
],
'instructions' => '<string>',
'prompts' => [
'agent' => '<string>',
'goal' => '<string>'
],
'phone_number' => '<string>',
'incoming_call_greeting' => '<string>',
'outgoing_call_greeting' => '<string>',
'synthesizer' => '<string>',
'voice_id' => '<string>',
'language' => '<string>',
'enable_recordings' => true,
'behaviour' => [
'speed' => '<string>',
'emotions' => [
'anger' => '<string>',
'curiosity' => '<string>',
'positivity' => '<string>',
'surprise' => '<string>',
'sadness' => '<string>'
]
],
'kb_id' => '<string>',
'additional_settings' => [
'Synthesizer' => [
'Azure' => [
'voice_name' => '<string>',
'rate' => '<string>',
'language_code' => '<string>'
],
'Cartesia' => [
'speed' => '<string>',
'emotion' => [
]
],
'ElevenLabs' => [
'stability' => '<string>',
'style_exaggeration' => '<string>',
'similarity' => '<string>',
'optimize_latency' => '<string>'
]
],
'Transcriber' => [
'Deepgram' => [
'language' => '<string>',
'keywords' => [
'<string>'
]
]
],
'Agent' => [
'OpenAI' => [
'temperature' => 123,
'max_tokens' => 123,
'backchannel_probability' => 123
],
'model' => '<string>',
'temperature' => 123,
'max_tokens' => 123,
'allow_incoming_messages' => true,
'time_zone' => '<string>',
'initial_message' => '<string>',
'initial_message_delay' => 123,
'interrupt_sensitivity' => '<string>',
'max_call_duration' => 123,
'end_conversation_on_goodbye' => true,
'goodbye_phrases' => [
'<string>'
],
'reminder' => [
'allowed_idle_time_seconds' => 123,
'num_check_human_present_times' => 123,
'reminder_messages' => [
'<string>'
],
'message_before_termination' => '<string>'
]
],
'SynthesizerUsed' => '<string>',
'TranscriberUsed' => '<string>',
'AgentUsed' => '<string>',
'save_transcripts' => true,
'enable_voicemail_detection' => true,
'voicemail_message' => '<string>',
'check_idle_time' => true
],
'action_ids' => [
'<string>'
],
'response_time' => 123,
'version' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"model\": \"<string>\",\n \"api_keys\": [\n {\n \"api_key_id\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"instructions\": \"<string>\",\n \"prompts\": {\n \"agent\": \"<string>\",\n \"goal\": \"<string>\"\n },\n \"phone_number\": \"<string>\",\n \"incoming_call_greeting\": \"<string>\",\n \"outgoing_call_greeting\": \"<string>\",\n \"synthesizer\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"enable_recordings\": true,\n \"behaviour\": {\n \"speed\": \"<string>\",\n \"emotions\": {\n \"anger\": \"<string>\",\n \"curiosity\": \"<string>\",\n \"positivity\": \"<string>\",\n \"surprise\": \"<string>\",\n \"sadness\": \"<string>\"\n }\n },\n \"kb_id\": \"<string>\",\n \"additional_settings\": {\n \"Synthesizer\": {\n \"Azure\": {\n \"voice_name\": \"<string>\",\n \"rate\": \"<string>\",\n \"language_code\": \"<string>\"\n },\n \"Cartesia\": {\n \"speed\": \"<string>\",\n \"emotion\": {}\n },\n \"ElevenLabs\": {\n \"stability\": \"<string>\",\n \"style_exaggeration\": \"<string>\",\n \"similarity\": \"<string>\",\n \"optimize_latency\": \"<string>\"\n }\n },\n \"Transcriber\": {\n \"Deepgram\": {\n \"language\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n }\n },\n \"Agent\": {\n \"OpenAI\": {\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"backchannel_probability\": 123\n },\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"allow_incoming_messages\": true,\n \"time_zone\": \"<string>\",\n \"initial_message\": \"<string>\",\n \"initial_message_delay\": 123,\n \"interrupt_sensitivity\": \"<string>\",\n \"max_call_duration\": 123,\n \"end_conversation_on_goodbye\": true,\n \"goodbye_phrases\": [\n \"<string>\"\n ],\n \"reminder\": {\n \"allowed_idle_time_seconds\": 123,\n \"num_check_human_present_times\": 123,\n \"reminder_messages\": [\n \"<string>\"\n ],\n \"message_before_termination\": \"<string>\"\n }\n },\n \"SynthesizerUsed\": \"<string>\",\n \"TranscriberUsed\": \"<string>\",\n \"AgentUsed\": \"<string>\",\n \"save_transcripts\": true,\n \"enable_voicemail_detection\": true,\n \"voicemail_message\": \"<string>\",\n \"check_idle_time\": true\n },\n \"action_ids\": [\n \"<string>\"\n ],\n \"response_time\": 123,\n \"version\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"model\": \"<string>\",\n \"api_keys\": [\n {\n \"api_key_id\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"instructions\": \"<string>\",\n \"prompts\": {\n \"agent\": \"<string>\",\n \"goal\": \"<string>\"\n },\n \"phone_number\": \"<string>\",\n \"incoming_call_greeting\": \"<string>\",\n \"outgoing_call_greeting\": \"<string>\",\n \"synthesizer\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"enable_recordings\": true,\n \"behaviour\": {\n \"speed\": \"<string>\",\n \"emotions\": {\n \"anger\": \"<string>\",\n \"curiosity\": \"<string>\",\n \"positivity\": \"<string>\",\n \"surprise\": \"<string>\",\n \"sadness\": \"<string>\"\n }\n },\n \"kb_id\": \"<string>\",\n \"additional_settings\": {\n \"Synthesizer\": {\n \"Azure\": {\n \"voice_name\": \"<string>\",\n \"rate\": \"<string>\",\n \"language_code\": \"<string>\"\n },\n \"Cartesia\": {\n \"speed\": \"<string>\",\n \"emotion\": {}\n },\n \"ElevenLabs\": {\n \"stability\": \"<string>\",\n \"style_exaggeration\": \"<string>\",\n \"similarity\": \"<string>\",\n \"optimize_latency\": \"<string>\"\n }\n },\n \"Transcriber\": {\n \"Deepgram\": {\n \"language\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n }\n },\n \"Agent\": {\n \"OpenAI\": {\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"backchannel_probability\": 123\n },\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"allow_incoming_messages\": true,\n \"time_zone\": \"<string>\",\n \"initial_message\": \"<string>\",\n \"initial_message_delay\": 123,\n \"interrupt_sensitivity\": \"<string>\",\n \"max_call_duration\": 123,\n \"end_conversation_on_goodbye\": true,\n \"goodbye_phrases\": [\n \"<string>\"\n ],\n \"reminder\": {\n \"allowed_idle_time_seconds\": 123,\n \"num_check_human_present_times\": 123,\n \"reminder_messages\": [\n \"<string>\"\n ],\n \"message_before_termination\": \"<string>\"\n }\n },\n \"SynthesizerUsed\": \"<string>\",\n \"TranscriberUsed\": \"<string>\",\n \"AgentUsed\": \"<string>\",\n \"save_transcripts\": true,\n \"enable_voicemail_detection\": true,\n \"voicemail_message\": \"<string>\",\n \"check_idle_time\": true\n },\n \"action_ids\": [\n \"<string>\"\n ],\n \"response_time\": 123,\n \"version\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"model\": \"<string>\",\n \"api_keys\": [\n {\n \"api_key_id\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"instructions\": \"<string>\",\n \"prompts\": {\n \"agent\": \"<string>\",\n \"goal\": \"<string>\"\n },\n \"phone_number\": \"<string>\",\n \"incoming_call_greeting\": \"<string>\",\n \"outgoing_call_greeting\": \"<string>\",\n \"synthesizer\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"enable_recordings\": true,\n \"behaviour\": {\n \"speed\": \"<string>\",\n \"emotions\": {\n \"anger\": \"<string>\",\n \"curiosity\": \"<string>\",\n \"positivity\": \"<string>\",\n \"surprise\": \"<string>\",\n \"sadness\": \"<string>\"\n }\n },\n \"kb_id\": \"<string>\",\n \"additional_settings\": {\n \"Synthesizer\": {\n \"Azure\": {\n \"voice_name\": \"<string>\",\n \"rate\": \"<string>\",\n \"language_code\": \"<string>\"\n },\n \"Cartesia\": {\n \"speed\": \"<string>\",\n \"emotion\": {}\n },\n \"ElevenLabs\": {\n \"stability\": \"<string>\",\n \"style_exaggeration\": \"<string>\",\n \"similarity\": \"<string>\",\n \"optimize_latency\": \"<string>\"\n }\n },\n \"Transcriber\": {\n \"Deepgram\": {\n \"language\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n }\n },\n \"Agent\": {\n \"OpenAI\": {\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"backchannel_probability\": 123\n },\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"allow_incoming_messages\": true,\n \"time_zone\": \"<string>\",\n \"initial_message\": \"<string>\",\n \"initial_message_delay\": 123,\n \"interrupt_sensitivity\": \"<string>\",\n \"max_call_duration\": 123,\n \"end_conversation_on_goodbye\": true,\n \"goodbye_phrases\": [\n \"<string>\"\n ],\n \"reminder\": {\n \"allowed_idle_time_seconds\": 123,\n \"num_check_human_present_times\": 123,\n \"reminder_messages\": [\n \"<string>\"\n ],\n \"message_before_termination\": \"<string>\"\n }\n },\n \"SynthesizerUsed\": \"<string>\",\n \"TranscriberUsed\": \"<string>\",\n \"AgentUsed\": \"<string>\",\n \"save_transcripts\": true,\n \"enable_voicemail_detection\": true,\n \"voicemail_message\": \"<string>\",\n \"check_idle_time\": true\n },\n \"action_ids\": [\n \"<string>\"\n ],\n \"response_time\": 123,\n \"version\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ctx_id": "<string>",
"data": {
"assistant_id": "<string>",
"name": "<string>"
}
}Create-Assistants
Create Voice AI Agent
Create new voice AI assistants with comprehensive configuration including instructions, voice settings, agent behavior, and call handling.
POST
/
v2
/
_new_assistants
Create Voice AI Agent
curl --request POST \
--url https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"model": "<string>",
"api_keys": [
{
"api_key_id": 123,
"type": "<string>"
}
],
"instructions": "<string>",
"prompts": {
"agent": "<string>",
"goal": "<string>"
},
"phone_number": "<string>",
"incoming_call_greeting": "<string>",
"outgoing_call_greeting": "<string>",
"synthesizer": "<string>",
"voice_id": "<string>",
"language": "<string>",
"enable_recordings": true,
"behaviour": {
"speed": "<string>",
"emotions": {
"anger": "<string>",
"curiosity": "<string>",
"positivity": "<string>",
"surprise": "<string>",
"sadness": "<string>"
}
},
"kb_id": "<string>",
"additional_settings": {
"Synthesizer": {
"Azure": {
"voice_name": "<string>",
"rate": "<string>",
"language_code": "<string>"
},
"Cartesia": {
"speed": "<string>",
"emotion": {}
},
"ElevenLabs": {
"stability": "<string>",
"style_exaggeration": "<string>",
"similarity": "<string>",
"optimize_latency": "<string>"
}
},
"Transcriber": {
"Deepgram": {
"language": "<string>",
"keywords": [
"<string>"
]
}
},
"Agent": {
"OpenAI": {
"temperature": 123,
"max_tokens": 123,
"backchannel_probability": 123
},
"model": "<string>",
"temperature": 123,
"max_tokens": 123,
"allow_incoming_messages": true,
"time_zone": "<string>",
"initial_message": "<string>",
"initial_message_delay": 123,
"interrupt_sensitivity": "<string>",
"max_call_duration": 123,
"end_conversation_on_goodbye": true,
"goodbye_phrases": [
"<string>"
],
"reminder": {
"allowed_idle_time_seconds": 123,
"num_check_human_present_times": 123,
"reminder_messages": [
"<string>"
],
"message_before_termination": "<string>"
}
},
"SynthesizerUsed": "<string>",
"TranscriberUsed": "<string>",
"AgentUsed": "<string>",
"save_transcripts": true,
"enable_voicemail_detection": true,
"voicemail_message": "<string>",
"check_idle_time": true
},
"action_ids": [
"<string>"
],
"response_time": 123,
"version": "<string>"
}
'import requests
url = "https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants"
payload = {
"name": "<string>",
"type": "<string>",
"model": "<string>",
"api_keys": [
{
"api_key_id": 123,
"type": "<string>"
}
],
"instructions": "<string>",
"prompts": {
"agent": "<string>",
"goal": "<string>"
},
"phone_number": "<string>",
"incoming_call_greeting": "<string>",
"outgoing_call_greeting": "<string>",
"synthesizer": "<string>",
"voice_id": "<string>",
"language": "<string>",
"enable_recordings": True,
"behaviour": {
"speed": "<string>",
"emotions": {
"anger": "<string>",
"curiosity": "<string>",
"positivity": "<string>",
"surprise": "<string>",
"sadness": "<string>"
}
},
"kb_id": "<string>",
"additional_settings": {
"Synthesizer": {
"Azure": {
"voice_name": "<string>",
"rate": "<string>",
"language_code": "<string>"
},
"Cartesia": {
"speed": "<string>",
"emotion": {}
},
"ElevenLabs": {
"stability": "<string>",
"style_exaggeration": "<string>",
"similarity": "<string>",
"optimize_latency": "<string>"
}
},
"Transcriber": { "Deepgram": {
"language": "<string>",
"keywords": ["<string>"]
} },
"Agent": {
"OpenAI": {
"temperature": 123,
"max_tokens": 123,
"backchannel_probability": 123
},
"model": "<string>",
"temperature": 123,
"max_tokens": 123,
"allow_incoming_messages": True,
"time_zone": "<string>",
"initial_message": "<string>",
"initial_message_delay": 123,
"interrupt_sensitivity": "<string>",
"max_call_duration": 123,
"end_conversation_on_goodbye": True,
"goodbye_phrases": ["<string>"],
"reminder": {
"allowed_idle_time_seconds": 123,
"num_check_human_present_times": 123,
"reminder_messages": ["<string>"],
"message_before_termination": "<string>"
}
},
"SynthesizerUsed": "<string>",
"TranscriberUsed": "<string>",
"AgentUsed": "<string>",
"save_transcripts": True,
"enable_voicemail_detection": True,
"voicemail_message": "<string>",
"check_idle_time": True
},
"action_ids": ["<string>"],
"response_time": 123,
"version": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
model: '<string>',
api_keys: [{api_key_id: 123, type: '<string>'}],
instructions: '<string>',
prompts: {agent: '<string>', goal: '<string>'},
phone_number: '<string>',
incoming_call_greeting: '<string>',
outgoing_call_greeting: '<string>',
synthesizer: '<string>',
voice_id: '<string>',
language: '<string>',
enable_recordings: true,
behaviour: {
speed: '<string>',
emotions: {
anger: '<string>',
curiosity: '<string>',
positivity: '<string>',
surprise: '<string>',
sadness: '<string>'
}
},
kb_id: '<string>',
additional_settings: {
Synthesizer: {
Azure: {voice_name: '<string>', rate: '<string>', language_code: '<string>'},
Cartesia: {speed: '<string>', emotion: {}},
ElevenLabs: {
stability: '<string>',
style_exaggeration: '<string>',
similarity: '<string>',
optimize_latency: '<string>'
}
},
Transcriber: {Deepgram: {language: '<string>', keywords: ['<string>']}},
Agent: {
OpenAI: {temperature: 123, max_tokens: 123, backchannel_probability: 123},
model: '<string>',
temperature: 123,
max_tokens: 123,
allow_incoming_messages: true,
time_zone: '<string>',
initial_message: '<string>',
initial_message_delay: 123,
interrupt_sensitivity: '<string>',
max_call_duration: 123,
end_conversation_on_goodbye: true,
goodbye_phrases: ['<string>'],
reminder: {
allowed_idle_time_seconds: 123,
num_check_human_present_times: 123,
reminder_messages: ['<string>'],
message_before_termination: '<string>'
}
},
SynthesizerUsed: '<string>',
TranscriberUsed: '<string>',
AgentUsed: '<string>',
save_transcripts: true,
enable_voicemail_detection: true,
voicemail_message: '<string>',
check_idle_time: true
},
action_ids: ['<string>'],
response_time: 123,
version: '<string>'
})
};
fetch('https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants', 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://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants",
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>',
'type' => '<string>',
'model' => '<string>',
'api_keys' => [
[
'api_key_id' => 123,
'type' => '<string>'
]
],
'instructions' => '<string>',
'prompts' => [
'agent' => '<string>',
'goal' => '<string>'
],
'phone_number' => '<string>',
'incoming_call_greeting' => '<string>',
'outgoing_call_greeting' => '<string>',
'synthesizer' => '<string>',
'voice_id' => '<string>',
'language' => '<string>',
'enable_recordings' => true,
'behaviour' => [
'speed' => '<string>',
'emotions' => [
'anger' => '<string>',
'curiosity' => '<string>',
'positivity' => '<string>',
'surprise' => '<string>',
'sadness' => '<string>'
]
],
'kb_id' => '<string>',
'additional_settings' => [
'Synthesizer' => [
'Azure' => [
'voice_name' => '<string>',
'rate' => '<string>',
'language_code' => '<string>'
],
'Cartesia' => [
'speed' => '<string>',
'emotion' => [
]
],
'ElevenLabs' => [
'stability' => '<string>',
'style_exaggeration' => '<string>',
'similarity' => '<string>',
'optimize_latency' => '<string>'
]
],
'Transcriber' => [
'Deepgram' => [
'language' => '<string>',
'keywords' => [
'<string>'
]
]
],
'Agent' => [
'OpenAI' => [
'temperature' => 123,
'max_tokens' => 123,
'backchannel_probability' => 123
],
'model' => '<string>',
'temperature' => 123,
'max_tokens' => 123,
'allow_incoming_messages' => true,
'time_zone' => '<string>',
'initial_message' => '<string>',
'initial_message_delay' => 123,
'interrupt_sensitivity' => '<string>',
'max_call_duration' => 123,
'end_conversation_on_goodbye' => true,
'goodbye_phrases' => [
'<string>'
],
'reminder' => [
'allowed_idle_time_seconds' => 123,
'num_check_human_present_times' => 123,
'reminder_messages' => [
'<string>'
],
'message_before_termination' => '<string>'
]
],
'SynthesizerUsed' => '<string>',
'TranscriberUsed' => '<string>',
'AgentUsed' => '<string>',
'save_transcripts' => true,
'enable_voicemail_detection' => true,
'voicemail_message' => '<string>',
'check_idle_time' => true
],
'action_ids' => [
'<string>'
],
'response_time' => 123,
'version' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"model\": \"<string>\",\n \"api_keys\": [\n {\n \"api_key_id\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"instructions\": \"<string>\",\n \"prompts\": {\n \"agent\": \"<string>\",\n \"goal\": \"<string>\"\n },\n \"phone_number\": \"<string>\",\n \"incoming_call_greeting\": \"<string>\",\n \"outgoing_call_greeting\": \"<string>\",\n \"synthesizer\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"enable_recordings\": true,\n \"behaviour\": {\n \"speed\": \"<string>\",\n \"emotions\": {\n \"anger\": \"<string>\",\n \"curiosity\": \"<string>\",\n \"positivity\": \"<string>\",\n \"surprise\": \"<string>\",\n \"sadness\": \"<string>\"\n }\n },\n \"kb_id\": \"<string>\",\n \"additional_settings\": {\n \"Synthesizer\": {\n \"Azure\": {\n \"voice_name\": \"<string>\",\n \"rate\": \"<string>\",\n \"language_code\": \"<string>\"\n },\n \"Cartesia\": {\n \"speed\": \"<string>\",\n \"emotion\": {}\n },\n \"ElevenLabs\": {\n \"stability\": \"<string>\",\n \"style_exaggeration\": \"<string>\",\n \"similarity\": \"<string>\",\n \"optimize_latency\": \"<string>\"\n }\n },\n \"Transcriber\": {\n \"Deepgram\": {\n \"language\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n }\n },\n \"Agent\": {\n \"OpenAI\": {\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"backchannel_probability\": 123\n },\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"allow_incoming_messages\": true,\n \"time_zone\": \"<string>\",\n \"initial_message\": \"<string>\",\n \"initial_message_delay\": 123,\n \"interrupt_sensitivity\": \"<string>\",\n \"max_call_duration\": 123,\n \"end_conversation_on_goodbye\": true,\n \"goodbye_phrases\": [\n \"<string>\"\n ],\n \"reminder\": {\n \"allowed_idle_time_seconds\": 123,\n \"num_check_human_present_times\": 123,\n \"reminder_messages\": [\n \"<string>\"\n ],\n \"message_before_termination\": \"<string>\"\n }\n },\n \"SynthesizerUsed\": \"<string>\",\n \"TranscriberUsed\": \"<string>\",\n \"AgentUsed\": \"<string>\",\n \"save_transcripts\": true,\n \"enable_voicemail_detection\": true,\n \"voicemail_message\": \"<string>\",\n \"check_idle_time\": true\n },\n \"action_ids\": [\n \"<string>\"\n ],\n \"response_time\": 123,\n \"version\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"model\": \"<string>\",\n \"api_keys\": [\n {\n \"api_key_id\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"instructions\": \"<string>\",\n \"prompts\": {\n \"agent\": \"<string>\",\n \"goal\": \"<string>\"\n },\n \"phone_number\": \"<string>\",\n \"incoming_call_greeting\": \"<string>\",\n \"outgoing_call_greeting\": \"<string>\",\n \"synthesizer\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"enable_recordings\": true,\n \"behaviour\": {\n \"speed\": \"<string>\",\n \"emotions\": {\n \"anger\": \"<string>\",\n \"curiosity\": \"<string>\",\n \"positivity\": \"<string>\",\n \"surprise\": \"<string>\",\n \"sadness\": \"<string>\"\n }\n },\n \"kb_id\": \"<string>\",\n \"additional_settings\": {\n \"Synthesizer\": {\n \"Azure\": {\n \"voice_name\": \"<string>\",\n \"rate\": \"<string>\",\n \"language_code\": \"<string>\"\n },\n \"Cartesia\": {\n \"speed\": \"<string>\",\n \"emotion\": {}\n },\n \"ElevenLabs\": {\n \"stability\": \"<string>\",\n \"style_exaggeration\": \"<string>\",\n \"similarity\": \"<string>\",\n \"optimize_latency\": \"<string>\"\n }\n },\n \"Transcriber\": {\n \"Deepgram\": {\n \"language\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n }\n },\n \"Agent\": {\n \"OpenAI\": {\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"backchannel_probability\": 123\n },\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"allow_incoming_messages\": true,\n \"time_zone\": \"<string>\",\n \"initial_message\": \"<string>\",\n \"initial_message_delay\": 123,\n \"interrupt_sensitivity\": \"<string>\",\n \"max_call_duration\": 123,\n \"end_conversation_on_goodbye\": true,\n \"goodbye_phrases\": [\n \"<string>\"\n ],\n \"reminder\": {\n \"allowed_idle_time_seconds\": 123,\n \"num_check_human_present_times\": 123,\n \"reminder_messages\": [\n \"<string>\"\n ],\n \"message_before_termination\": \"<string>\"\n }\n },\n \"SynthesizerUsed\": \"<string>\",\n \"TranscriberUsed\": \"<string>\",\n \"AgentUsed\": \"<string>\",\n \"save_transcripts\": true,\n \"enable_voicemail_detection\": true,\n \"voicemail_message\": \"<string>\",\n \"check_idle_time\": true\n },\n \"action_ids\": [\n \"<string>\"\n ],\n \"response_time\": 123,\n \"version\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"model\": \"<string>\",\n \"api_keys\": [\n {\n \"api_key_id\": 123,\n \"type\": \"<string>\"\n }\n ],\n \"instructions\": \"<string>\",\n \"prompts\": {\n \"agent\": \"<string>\",\n \"goal\": \"<string>\"\n },\n \"phone_number\": \"<string>\",\n \"incoming_call_greeting\": \"<string>\",\n \"outgoing_call_greeting\": \"<string>\",\n \"synthesizer\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"enable_recordings\": true,\n \"behaviour\": {\n \"speed\": \"<string>\",\n \"emotions\": {\n \"anger\": \"<string>\",\n \"curiosity\": \"<string>\",\n \"positivity\": \"<string>\",\n \"surprise\": \"<string>\",\n \"sadness\": \"<string>\"\n }\n },\n \"kb_id\": \"<string>\",\n \"additional_settings\": {\n \"Synthesizer\": {\n \"Azure\": {\n \"voice_name\": \"<string>\",\n \"rate\": \"<string>\",\n \"language_code\": \"<string>\"\n },\n \"Cartesia\": {\n \"speed\": \"<string>\",\n \"emotion\": {}\n },\n \"ElevenLabs\": {\n \"stability\": \"<string>\",\n \"style_exaggeration\": \"<string>\",\n \"similarity\": \"<string>\",\n \"optimize_latency\": \"<string>\"\n }\n },\n \"Transcriber\": {\n \"Deepgram\": {\n \"language\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ]\n }\n },\n \"Agent\": {\n \"OpenAI\": {\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"backchannel_probability\": 123\n },\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"allow_incoming_messages\": true,\n \"time_zone\": \"<string>\",\n \"initial_message\": \"<string>\",\n \"initial_message_delay\": 123,\n \"interrupt_sensitivity\": \"<string>\",\n \"max_call_duration\": 123,\n \"end_conversation_on_goodbye\": true,\n \"goodbye_phrases\": [\n \"<string>\"\n ],\n \"reminder\": {\n \"allowed_idle_time_seconds\": 123,\n \"num_check_human_present_times\": 123,\n \"reminder_messages\": [\n \"<string>\"\n ],\n \"message_before_termination\": \"<string>\"\n }\n },\n \"SynthesizerUsed\": \"<string>\",\n \"TranscriberUsed\": \"<string>\",\n \"AgentUsed\": \"<string>\",\n \"save_transcripts\": true,\n \"enable_voicemail_detection\": true,\n \"voicemail_message\": \"<string>\",\n \"check_idle_time\": true\n },\n \"action_ids\": [\n \"<string>\"\n ],\n \"response_time\": 123,\n \"version\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ctx_id": "<string>",
"data": {
"assistant_id": "<string>",
"name": "<string>"
}
}Authorizations
Enter your ContactSwing JWT Bearer token.
Request Body
Assistant display name. Example:
"Insurance Darren"Assistant type. Example:
"VOICE_INCOMING"LLM model. Example:
"cw-llm-1"API Keys
Instructions
Detailed agent instructions and behavior rules
Prompts
Phone & Greetings
Assigned phone number. Example:
"+13465842882"Greeting played on incoming calls
Greeting played on outgoing calls
Voice & Language
Voice synthesizer. Example:
"AZURE"Voice ID. Example:
"en-US-LunaNeural"Language. Example:
"english"Enable call recordings
Behaviour Settings
Knowledge Base
Knowledge base ID (nullable)
Additional Settings
Actions & Meta
Linked action IDs
Example:
"v1"Response
201 CreatedRequest context ID
401 Unauthorized – Invalid token
⌘I

