curl --request POST \
--url https://api-prod.interactly.ai/calls/v1/conversations/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"direction": "outbound",
"phoneNumberId": "5f7b1b1b1b1b1b1b1b1b1b1b",
"customer": {
"number": "<string>",
"name": "<string>"
},
"metadata": {
"key": "value"
},
"assistant": {
"name": "My Assistant",
"welcomeMessage": "Hello! How can I help you?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"assistantProvider": "openai",
"assistantModel": "gpt-4o-mini",
"assistantLLMUrl": "<string>",
"assistantSystemPrompt": "You are AI assistant to help patients with their health care needs.",
"assistantTemperature": 0,
"assistantMaxTokens": 256,
"assistantResponseSplitter": ",",
"config": {
"speech": {
"stt": {
"vendor": "microsoft",
"languages": "en-US"
},
"sttFallback": {
"enabled": true,
"vendor": "microsoft",
"languages": "en-US"
},
"ttsData": [
{
"enabled": true,
"vendor": "eleven-labs",
"language": "en-US",
"voice": "ZeK6O9RfGNGj0cJT2HoJ",
"config": {
"modelId": "eleven_multilingual_v2",
"stability": 0.7,
"similarityBoost": 0.85,
"speakerBoost": true,
"styleExaggeration": 0.5,
"seed": 42,
"speed": 1,
"applyTextNormalization": true
}
}
]
}
},
"hints": [
"<string>"
],
"backgroundSound": "enable",
"backgroundSoundVolume": 50,
"ttsCacheEnabled": false,
"maxConsecutiveTtsFailures": 2,
"recordingEnabled": true,
"recordAfterTransfer": false,
"postCallTranscriptsEnabled": false,
"assistantBackchannelingEnabled": false,
"dtmfInputEnabled": false,
"maxCallDuration": 900,
"idleTimeout": 20,
"maxIdleMessagesInSequence": 3,
"startSpeakingOptions": {
"waitSeconds": 0,
"smartEndpointing": "Interactly",
"onPunctuationSeconds": 0,
"onNoPunctuationSeconds": 0,
"onNumberSeconds": 0,
"LiveKitBaseValue": 100,
"LiveKitScaleValue": 1000
},
"stopSpeakingOptions": {
"numberOfWords": 3,
"voiceSeconds": 0
},
"userInterruptionAckPlan": {
"enabled": true,
"count": 2,
"words": 4,
"phrases": [
"Please hold on while I check your account.",
"one moment please",
"let me just check that for you"
]
},
"assistantToolIds": [],
"assistantPredefinedTools": {
"knowledgeBase": false,
"endCall": false,
"appointment": false,
"volumeControl": false,
"waitList": false,
"callForward": false,
"sendSms": false
},
"assistantType": "single_prompt",
"assistantKnowledgeBaseIds": [],
"endCallMessage": "Goodbye!",
"endCallToolDescription": "Trigger the end call only when the user is done with the conversation.",
"endCallPhrases": [
"goodbye",
"bye"
],
"callForwardData": {
"phoneNumber": "+1234567890",
"extension": "",
"name": "call-forward-name"
},
"warmTransferEnabled": false,
"warmTransferConversational": false,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"assistantAnalysis": {
"summary": {
"enabled": false,
"prompt": "Generate a summary of the call.",
"timeoutSeconds": 30
},
"successEvaluation": {
"enabled": false,
"prompt": "Evaluate the success of the call.",
"timeoutSeconds": 30
},
"structuredData": {
"enabled": false,
"prompt": "Extract structured data from the call.",
"timeoutSeconds": 30,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "This is the name of the user.",
"example": "John Doe"
},
"dob": {
"type": "string",
"format": "date",
"description": "This is the date of birth of the user.",
"example": "1990-03-08"
}
}
}
}
},
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"recordingEnabled": true,
"recordAfterTransfer": false,
"postCallTranscriptsEnabled": false,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": false,
"warmTransferConversational": false,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
},
"assistantOutcome": [
{
"type": "<string>",
"field": "<string>"
}
],
"smsConfiguration": {
"enabled": true,
"sameAsAssistant": true,
"smsPrompt": "<string>"
},
"persistHistory": {
"enabled": true,
"call": true,
"sms": true,
"retentionPeriod": 7
}
},
"assistantId": "678a253ca6d866573043502e",
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"recordingEnabled": true,
"recordAfterTransfer": false,
"postCallTranscriptsEnabled": false,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": false,
"warmTransferConversational": false,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
}
}
'import requests
url = "https://api-prod.interactly.ai/calls/v1/conversations/connect"
payload = {
"direction": "outbound",
"phoneNumberId": "5f7b1b1b1b1b1b1b1b1b1b1b",
"customer": {
"number": "<string>",
"name": "<string>"
},
"metadata": { "key": "value" },
"assistant": {
"name": "My Assistant",
"welcomeMessage": "Hello! How can I help you?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": False,
"assistantProvider": "openai",
"assistantModel": "gpt-4o-mini",
"assistantLLMUrl": "<string>",
"assistantSystemPrompt": "You are AI assistant to help patients with their health care needs.",
"assistantTemperature": 0,
"assistantMaxTokens": 256,
"assistantResponseSplitter": ",",
"config": { "speech": {
"stt": {
"vendor": "microsoft",
"languages": "en-US"
},
"sttFallback": {
"enabled": True,
"vendor": "microsoft",
"languages": "en-US"
},
"ttsData": [
{
"enabled": True,
"vendor": "eleven-labs",
"language": "en-US",
"voice": "ZeK6O9RfGNGj0cJT2HoJ",
"config": {
"modelId": "eleven_multilingual_v2",
"stability": 0.7,
"similarityBoost": 0.85,
"speakerBoost": True,
"styleExaggeration": 0.5,
"seed": 42,
"speed": 1,
"applyTextNormalization": True
}
}
]
} },
"hints": ["<string>"],
"backgroundSound": "enable",
"backgroundSoundVolume": 50,
"ttsCacheEnabled": False,
"maxConsecutiveTtsFailures": 2,
"recordingEnabled": True,
"recordAfterTransfer": False,
"postCallTranscriptsEnabled": False,
"assistantBackchannelingEnabled": False,
"dtmfInputEnabled": False,
"maxCallDuration": 900,
"idleTimeout": 20,
"maxIdleMessagesInSequence": 3,
"startSpeakingOptions": {
"waitSeconds": 0,
"smartEndpointing": "Interactly",
"onPunctuationSeconds": 0,
"onNoPunctuationSeconds": 0,
"onNumberSeconds": 0,
"LiveKitBaseValue": 100,
"LiveKitScaleValue": 1000
},
"stopSpeakingOptions": {
"numberOfWords": 3,
"voiceSeconds": 0
},
"userInterruptionAckPlan": {
"enabled": True,
"count": 2,
"words": 4,
"phrases": ["Please hold on while I check your account.", "one moment please", "let me just check that for you"]
},
"assistantToolIds": [],
"assistantPredefinedTools": {
"knowledgeBase": False,
"endCall": False,
"appointment": False,
"volumeControl": False,
"waitList": False,
"callForward": False,
"sendSms": False
},
"assistantType": "single_prompt",
"assistantKnowledgeBaseIds": [],
"endCallMessage": "Goodbye!",
"endCallToolDescription": "Trigger the end call only when the user is done with the conversation.",
"endCallPhrases": ["goodbye", "bye"],
"callForwardData": {
"phoneNumber": "+1234567890",
"extension": "",
"name": "call-forward-name"
},
"warmTransferEnabled": False,
"warmTransferConversational": False,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"assistantAnalysis": {
"summary": {
"enabled": False,
"prompt": "Generate a summary of the call.",
"timeoutSeconds": 30
},
"successEvaluation": {
"enabled": False,
"prompt": "Evaluate the success of the call.",
"timeoutSeconds": 30
},
"structuredData": {
"enabled": False,
"prompt": "Extract structured data from the call.",
"timeoutSeconds": 30,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "This is the name of the user.",
"example": "John Doe"
},
"dob": {
"type": "string",
"format": "date",
"description": "This is the date of birth of the user.",
"example": "1990-03-08"
}
}
}
}
},
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": False,
"recordingEnabled": True,
"recordAfterTransfer": False,
"postCallTranscriptsEnabled": False,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": False,
"warmTransferConversational": False,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": { "user_name": "John Doe" }
},
"assistantOutcome": [
{
"type": "<string>",
"field": "<string>"
}
],
"smsConfiguration": {
"enabled": True,
"sameAsAssistant": True,
"smsPrompt": "<string>"
},
"persistHistory": {
"enabled": True,
"call": True,
"sms": True,
"retentionPeriod": 7
}
},
"assistantId": "678a253ca6d866573043502e",
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": False,
"recordingEnabled": True,
"recordAfterTransfer": False,
"postCallTranscriptsEnabled": False,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": False,
"warmTransferConversational": False,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": { "user_name": "John Doe" }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
direction: 'outbound',
phoneNumberId: '5f7b1b1b1b1b1b1b1b1b1b1b',
customer: {number: '<string>', name: '<string>'},
metadata: {key: 'value'},
assistant: {
name: 'My Assistant',
welcomeMessage: 'Hello! How can I help you?',
welcomeMessageMode: 'assistant-speaks-first',
welcomeMessageInterruptionsEnabled: false,
assistantProvider: 'openai',
assistantModel: 'gpt-4o-mini',
assistantLLMUrl: '<string>',
assistantSystemPrompt: 'You are AI assistant to help patients with their health care needs.',
assistantTemperature: 0,
assistantMaxTokens: 256,
assistantResponseSplitter: ',',
config: {
speech: {
stt: {vendor: 'microsoft', languages: 'en-US'},
sttFallback: {enabled: true, vendor: 'microsoft', languages: 'en-US'},
ttsData: [
{
enabled: true,
vendor: 'eleven-labs',
language: 'en-US',
voice: 'ZeK6O9RfGNGj0cJT2HoJ',
config: {
modelId: 'eleven_multilingual_v2',
stability: 0.7,
similarityBoost: 0.85,
speakerBoost: true,
styleExaggeration: 0.5,
seed: 42,
speed: 1,
applyTextNormalization: true
}
}
]
}
},
hints: ['<string>'],
backgroundSound: 'enable',
backgroundSoundVolume: 50,
ttsCacheEnabled: false,
maxConsecutiveTtsFailures: 2,
recordingEnabled: true,
recordAfterTransfer: false,
postCallTranscriptsEnabled: false,
assistantBackchannelingEnabled: false,
dtmfInputEnabled: false,
maxCallDuration: 900,
idleTimeout: 20,
maxIdleMessagesInSequence: 3,
startSpeakingOptions: {
waitSeconds: 0,
smartEndpointing: 'Interactly',
onPunctuationSeconds: 0,
onNoPunctuationSeconds: 0,
onNumberSeconds: 0,
LiveKitBaseValue: 100,
LiveKitScaleValue: 1000
},
stopSpeakingOptions: {numberOfWords: 3, voiceSeconds: 0},
userInterruptionAckPlan: {
enabled: true,
count: 2,
words: 4,
phrases: [
'Please hold on while I check your account.',
'one moment please',
'let me just check that for you'
]
},
assistantToolIds: [],
assistantPredefinedTools: {
knowledgeBase: false,
endCall: false,
appointment: false,
volumeControl: false,
waitList: false,
callForward: false,
sendSms: false
},
assistantType: 'single_prompt',
assistantKnowledgeBaseIds: [],
endCallMessage: 'Goodbye!',
endCallToolDescription: 'Trigger the end call only when the user is done with the conversation.',
endCallPhrases: ['goodbye', 'bye'],
callForwardData: {phoneNumber: '+1234567890', extension: '', name: 'call-forward-name'},
warmTransferEnabled: false,
warmTransferConversational: false,
holdMusicUrl: 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
warmTransferTimeout: 300,
assistantAnalysis: {
summary: {enabled: false, prompt: 'Generate a summary of the call.', timeoutSeconds: 30},
successEvaluation: {
enabled: false,
prompt: 'Evaluate the success of the call.',
timeoutSeconds: 30
},
structuredData: {
enabled: false,
prompt: 'Extract structured data from the call.',
timeoutSeconds: 30,
schema: {
type: 'object',
properties: {
name: {
type: 'string',
description: 'This is the name of the user.',
example: 'John Doe'
},
dob: {
type: 'string',
format: 'date',
description: 'This is the date of birth of the user.',
example: '1990-03-08'
}
}
}
}
},
assistantOverrides: {
welcomeMessage: 'Hello, how can I help you today?',
welcomeMessageMode: 'assistant-speaks-first',
welcomeMessageInterruptionsEnabled: false,
recordingEnabled: true,
recordAfterTransfer: false,
postCallTranscriptsEnabled: false,
maxConsecutiveTtsFailures: 2,
warmTransferEnabled: false,
warmTransferConversational: false,
holdMusicUrl: 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
warmTransferTimeout: 300,
recordingPath: '/recordings',
dynamicVariables: {user_name: 'John Doe'}
},
assistantOutcome: [{type: '<string>', field: '<string>'}],
smsConfiguration: {enabled: true, sameAsAssistant: true, smsPrompt: '<string>'},
persistHistory: {enabled: true, call: true, sms: true, retentionPeriod: 7}
},
assistantId: '678a253ca6d866573043502e',
assistantOverrides: {
welcomeMessage: 'Hello, how can I help you today?',
welcomeMessageMode: 'assistant-speaks-first',
welcomeMessageInterruptionsEnabled: false,
recordingEnabled: true,
recordAfterTransfer: false,
postCallTranscriptsEnabled: false,
maxConsecutiveTtsFailures: 2,
warmTransferEnabled: false,
warmTransferConversational: false,
holdMusicUrl: 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
warmTransferTimeout: 300,
recordingPath: '/recordings',
dynamicVariables: {user_name: 'John Doe'}
}
})
};
fetch('https://api-prod.interactly.ai/calls/v1/conversations/connect', 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-prod.interactly.ai/calls/v1/conversations/connect",
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([
'direction' => 'outbound',
'phoneNumberId' => '5f7b1b1b1b1b1b1b1b1b1b1b',
'customer' => [
'number' => '<string>',
'name' => '<string>'
],
'metadata' => [
'key' => 'value'
],
'assistant' => [
'name' => 'My Assistant',
'welcomeMessage' => 'Hello! How can I help you?',
'welcomeMessageMode' => 'assistant-speaks-first',
'welcomeMessageInterruptionsEnabled' => false,
'assistantProvider' => 'openai',
'assistantModel' => 'gpt-4o-mini',
'assistantLLMUrl' => '<string>',
'assistantSystemPrompt' => 'You are AI assistant to help patients with their health care needs.',
'assistantTemperature' => 0,
'assistantMaxTokens' => 256,
'assistantResponseSplitter' => ',',
'config' => [
'speech' => [
'stt' => [
'vendor' => 'microsoft',
'languages' => 'en-US'
],
'sttFallback' => [
'enabled' => true,
'vendor' => 'microsoft',
'languages' => 'en-US'
],
'ttsData' => [
[
'enabled' => true,
'vendor' => 'eleven-labs',
'language' => 'en-US',
'voice' => 'ZeK6O9RfGNGj0cJT2HoJ',
'config' => [
'modelId' => 'eleven_multilingual_v2',
'stability' => 0.7,
'similarityBoost' => 0.85,
'speakerBoost' => true,
'styleExaggeration' => 0.5,
'seed' => 42,
'speed' => 1,
'applyTextNormalization' => true
]
]
]
]
],
'hints' => [
'<string>'
],
'backgroundSound' => 'enable',
'backgroundSoundVolume' => 50,
'ttsCacheEnabled' => false,
'maxConsecutiveTtsFailures' => 2,
'recordingEnabled' => true,
'recordAfterTransfer' => false,
'postCallTranscriptsEnabled' => false,
'assistantBackchannelingEnabled' => false,
'dtmfInputEnabled' => false,
'maxCallDuration' => 900,
'idleTimeout' => 20,
'maxIdleMessagesInSequence' => 3,
'startSpeakingOptions' => [
'waitSeconds' => 0,
'smartEndpointing' => 'Interactly',
'onPunctuationSeconds' => 0,
'onNoPunctuationSeconds' => 0,
'onNumberSeconds' => 0,
'LiveKitBaseValue' => 100,
'LiveKitScaleValue' => 1000
],
'stopSpeakingOptions' => [
'numberOfWords' => 3,
'voiceSeconds' => 0
],
'userInterruptionAckPlan' => [
'enabled' => true,
'count' => 2,
'words' => 4,
'phrases' => [
'Please hold on while I check your account.',
'one moment please',
'let me just check that for you'
]
],
'assistantToolIds' => [
],
'assistantPredefinedTools' => [
'knowledgeBase' => false,
'endCall' => false,
'appointment' => false,
'volumeControl' => false,
'waitList' => false,
'callForward' => false,
'sendSms' => false
],
'assistantType' => 'single_prompt',
'assistantKnowledgeBaseIds' => [
],
'endCallMessage' => 'Goodbye!',
'endCallToolDescription' => 'Trigger the end call only when the user is done with the conversation.',
'endCallPhrases' => [
'goodbye',
'bye'
],
'callForwardData' => [
'phoneNumber' => '+1234567890',
'extension' => '',
'name' => 'call-forward-name'
],
'warmTransferEnabled' => false,
'warmTransferConversational' => false,
'holdMusicUrl' => 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
'warmTransferTimeout' => 300,
'assistantAnalysis' => [
'summary' => [
'enabled' => false,
'prompt' => 'Generate a summary of the call.',
'timeoutSeconds' => 30
],
'successEvaluation' => [
'enabled' => false,
'prompt' => 'Evaluate the success of the call.',
'timeoutSeconds' => 30
],
'structuredData' => [
'enabled' => false,
'prompt' => 'Extract structured data from the call.',
'timeoutSeconds' => 30,
'schema' => [
'type' => 'object',
'properties' => [
'name' => [
'type' => 'string',
'description' => 'This is the name of the user.',
'example' => 'John Doe'
],
'dob' => [
'type' => 'string',
'format' => 'date',
'description' => 'This is the date of birth of the user.',
'example' => '1990-03-08'
]
]
]
]
],
'assistantOverrides' => [
'welcomeMessage' => 'Hello, how can I help you today?',
'welcomeMessageMode' => 'assistant-speaks-first',
'welcomeMessageInterruptionsEnabled' => false,
'recordingEnabled' => true,
'recordAfterTransfer' => false,
'postCallTranscriptsEnabled' => false,
'maxConsecutiveTtsFailures' => 2,
'warmTransferEnabled' => false,
'warmTransferConversational' => false,
'holdMusicUrl' => 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
'warmTransferTimeout' => 300,
'recordingPath' => '/recordings',
'dynamicVariables' => [
'user_name' => 'John Doe'
]
],
'assistantOutcome' => [
[
'type' => '<string>',
'field' => '<string>'
]
],
'smsConfiguration' => [
'enabled' => true,
'sameAsAssistant' => true,
'smsPrompt' => '<string>'
],
'persistHistory' => [
'enabled' => true,
'call' => true,
'sms' => true,
'retentionPeriod' => 7
]
],
'assistantId' => '678a253ca6d866573043502e',
'assistantOverrides' => [
'welcomeMessage' => 'Hello, how can I help you today?',
'welcomeMessageMode' => 'assistant-speaks-first',
'welcomeMessageInterruptionsEnabled' => false,
'recordingEnabled' => true,
'recordAfterTransfer' => false,
'postCallTranscriptsEnabled' => false,
'maxConsecutiveTtsFailures' => 2,
'warmTransferEnabled' => false,
'warmTransferConversational' => false,
'holdMusicUrl' => 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
'warmTransferTimeout' => 300,
'recordingPath' => '/recordings',
'dynamicVariables' => [
'user_name' => 'John Doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-prod.interactly.ai/calls/v1/conversations/connect"
payload := strings.NewReader("{\n \"direction\": \"outbound\",\n \"phoneNumberId\": \"5f7b1b1b1b1b1b1b1b1b1b1b\",\n \"customer\": {\n \"number\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"metadata\": {\n \"key\": \"value\"\n },\n \"assistant\": {\n \"name\": \"My Assistant\",\n \"welcomeMessage\": \"Hello! How can I help you?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"assistantProvider\": \"openai\",\n \"assistantModel\": \"gpt-4o-mini\",\n \"assistantLLMUrl\": \"<string>\",\n \"assistantSystemPrompt\": \"You are AI assistant to help patients with their health care needs.\",\n \"assistantTemperature\": 0,\n \"assistantMaxTokens\": 256,\n \"assistantResponseSplitter\": \",\",\n \"config\": {\n \"speech\": {\n \"stt\": {\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"sttFallback\": {\n \"enabled\": true,\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"ttsData\": [\n {\n \"enabled\": true,\n \"vendor\": \"eleven-labs\",\n \"language\": \"en-US\",\n \"voice\": \"ZeK6O9RfGNGj0cJT2HoJ\",\n \"config\": {\n \"modelId\": \"eleven_multilingual_v2\",\n \"stability\": 0.7,\n \"similarityBoost\": 0.85,\n \"speakerBoost\": true,\n \"styleExaggeration\": 0.5,\n \"seed\": 42,\n \"speed\": 1,\n \"applyTextNormalization\": true\n }\n }\n ]\n }\n },\n \"hints\": [\n \"<string>\"\n ],\n \"backgroundSound\": \"enable\",\n \"backgroundSoundVolume\": 50,\n \"ttsCacheEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"assistantBackchannelingEnabled\": false,\n \"dtmfInputEnabled\": false,\n \"maxCallDuration\": 900,\n \"idleTimeout\": 20,\n \"maxIdleMessagesInSequence\": 3,\n \"startSpeakingOptions\": {\n \"waitSeconds\": 0,\n \"smartEndpointing\": \"Interactly\",\n \"onPunctuationSeconds\": 0,\n \"onNoPunctuationSeconds\": 0,\n \"onNumberSeconds\": 0,\n \"LiveKitBaseValue\": 100,\n \"LiveKitScaleValue\": 1000\n },\n \"stopSpeakingOptions\": {\n \"numberOfWords\": 3,\n \"voiceSeconds\": 0\n },\n \"userInterruptionAckPlan\": {\n \"enabled\": true,\n \"count\": 2,\n \"words\": 4,\n \"phrases\": [\n \"Please hold on while I check your account.\",\n \"one moment please\",\n \"let me just check that for you\"\n ]\n },\n \"assistantToolIds\": [],\n \"assistantPredefinedTools\": {\n \"knowledgeBase\": false,\n \"endCall\": false,\n \"appointment\": false,\n \"volumeControl\": false,\n \"waitList\": false,\n \"callForward\": false,\n \"sendSms\": false\n },\n \"assistantType\": \"single_prompt\",\n \"assistantKnowledgeBaseIds\": [],\n \"endCallMessage\": \"Goodbye!\",\n \"endCallToolDescription\": \"Trigger the end call only when the user is done with the conversation.\",\n \"endCallPhrases\": [\n \"goodbye\",\n \"bye\"\n ],\n \"callForwardData\": {\n \"phoneNumber\": \"+1234567890\",\n \"extension\": \"\",\n \"name\": \"call-forward-name\"\n },\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"assistantAnalysis\": {\n \"summary\": {\n \"enabled\": false,\n \"prompt\": \"Generate a summary of the call.\",\n \"timeoutSeconds\": 30\n },\n \"successEvaluation\": {\n \"enabled\": false,\n \"prompt\": \"Evaluate the success of the call.\",\n \"timeoutSeconds\": 30\n },\n \"structuredData\": {\n \"enabled\": false,\n \"prompt\": \"Extract structured data from the call.\",\n \"timeoutSeconds\": 30,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"This is the name of the user.\",\n \"example\": \"John Doe\"\n },\n \"dob\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"This is the date of birth of the user.\",\n \"example\": \"1990-03-08\"\n }\n }\n }\n }\n },\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n },\n \"assistantOutcome\": [\n {\n \"type\": \"<string>\",\n \"field\": \"<string>\"\n }\n ],\n \"smsConfiguration\": {\n \"enabled\": true,\n \"sameAsAssistant\": true,\n \"smsPrompt\": \"<string>\"\n },\n \"persistHistory\": {\n \"enabled\": true,\n \"call\": true,\n \"sms\": true,\n \"retentionPeriod\": 7\n }\n },\n \"assistantId\": \"678a253ca6d866573043502e\",\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-prod.interactly.ai/calls/v1/conversations/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"direction\": \"outbound\",\n \"phoneNumberId\": \"5f7b1b1b1b1b1b1b1b1b1b1b\",\n \"customer\": {\n \"number\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"metadata\": {\n \"key\": \"value\"\n },\n \"assistant\": {\n \"name\": \"My Assistant\",\n \"welcomeMessage\": \"Hello! How can I help you?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"assistantProvider\": \"openai\",\n \"assistantModel\": \"gpt-4o-mini\",\n \"assistantLLMUrl\": \"<string>\",\n \"assistantSystemPrompt\": \"You are AI assistant to help patients with their health care needs.\",\n \"assistantTemperature\": 0,\n \"assistantMaxTokens\": 256,\n \"assistantResponseSplitter\": \",\",\n \"config\": {\n \"speech\": {\n \"stt\": {\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"sttFallback\": {\n \"enabled\": true,\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"ttsData\": [\n {\n \"enabled\": true,\n \"vendor\": \"eleven-labs\",\n \"language\": \"en-US\",\n \"voice\": \"ZeK6O9RfGNGj0cJT2HoJ\",\n \"config\": {\n \"modelId\": \"eleven_multilingual_v2\",\n \"stability\": 0.7,\n \"similarityBoost\": 0.85,\n \"speakerBoost\": true,\n \"styleExaggeration\": 0.5,\n \"seed\": 42,\n \"speed\": 1,\n \"applyTextNormalization\": true\n }\n }\n ]\n }\n },\n \"hints\": [\n \"<string>\"\n ],\n \"backgroundSound\": \"enable\",\n \"backgroundSoundVolume\": 50,\n \"ttsCacheEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"assistantBackchannelingEnabled\": false,\n \"dtmfInputEnabled\": false,\n \"maxCallDuration\": 900,\n \"idleTimeout\": 20,\n \"maxIdleMessagesInSequence\": 3,\n \"startSpeakingOptions\": {\n \"waitSeconds\": 0,\n \"smartEndpointing\": \"Interactly\",\n \"onPunctuationSeconds\": 0,\n \"onNoPunctuationSeconds\": 0,\n \"onNumberSeconds\": 0,\n \"LiveKitBaseValue\": 100,\n \"LiveKitScaleValue\": 1000\n },\n \"stopSpeakingOptions\": {\n \"numberOfWords\": 3,\n \"voiceSeconds\": 0\n },\n \"userInterruptionAckPlan\": {\n \"enabled\": true,\n \"count\": 2,\n \"words\": 4,\n \"phrases\": [\n \"Please hold on while I check your account.\",\n \"one moment please\",\n \"let me just check that for you\"\n ]\n },\n \"assistantToolIds\": [],\n \"assistantPredefinedTools\": {\n \"knowledgeBase\": false,\n \"endCall\": false,\n \"appointment\": false,\n \"volumeControl\": false,\n \"waitList\": false,\n \"callForward\": false,\n \"sendSms\": false\n },\n \"assistantType\": \"single_prompt\",\n \"assistantKnowledgeBaseIds\": [],\n \"endCallMessage\": \"Goodbye!\",\n \"endCallToolDescription\": \"Trigger the end call only when the user is done with the conversation.\",\n \"endCallPhrases\": [\n \"goodbye\",\n \"bye\"\n ],\n \"callForwardData\": {\n \"phoneNumber\": \"+1234567890\",\n \"extension\": \"\",\n \"name\": \"call-forward-name\"\n },\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"assistantAnalysis\": {\n \"summary\": {\n \"enabled\": false,\n \"prompt\": \"Generate a summary of the call.\",\n \"timeoutSeconds\": 30\n },\n \"successEvaluation\": {\n \"enabled\": false,\n \"prompt\": \"Evaluate the success of the call.\",\n \"timeoutSeconds\": 30\n },\n \"structuredData\": {\n \"enabled\": false,\n \"prompt\": \"Extract structured data from the call.\",\n \"timeoutSeconds\": 30,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"This is the name of the user.\",\n \"example\": \"John Doe\"\n },\n \"dob\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"This is the date of birth of the user.\",\n \"example\": \"1990-03-08\"\n }\n }\n }\n }\n },\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n },\n \"assistantOutcome\": [\n {\n \"type\": \"<string>\",\n \"field\": \"<string>\"\n }\n ],\n \"smsConfiguration\": {\n \"enabled\": true,\n \"sameAsAssistant\": true,\n \"smsPrompt\": \"<string>\"\n },\n \"persistHistory\": {\n \"enabled\": true,\n \"call\": true,\n \"sms\": true,\n \"retentionPeriod\": 7\n }\n },\n \"assistantId\": \"678a253ca6d866573043502e\",\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/calls/v1/conversations/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"direction\": \"outbound\",\n \"phoneNumberId\": \"5f7b1b1b1b1b1b1b1b1b1b1b\",\n \"customer\": {\n \"number\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"metadata\": {\n \"key\": \"value\"\n },\n \"assistant\": {\n \"name\": \"My Assistant\",\n \"welcomeMessage\": \"Hello! How can I help you?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"assistantProvider\": \"openai\",\n \"assistantModel\": \"gpt-4o-mini\",\n \"assistantLLMUrl\": \"<string>\",\n \"assistantSystemPrompt\": \"You are AI assistant to help patients with their health care needs.\",\n \"assistantTemperature\": 0,\n \"assistantMaxTokens\": 256,\n \"assistantResponseSplitter\": \",\",\n \"config\": {\n \"speech\": {\n \"stt\": {\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"sttFallback\": {\n \"enabled\": true,\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"ttsData\": [\n {\n \"enabled\": true,\n \"vendor\": \"eleven-labs\",\n \"language\": \"en-US\",\n \"voice\": \"ZeK6O9RfGNGj0cJT2HoJ\",\n \"config\": {\n \"modelId\": \"eleven_multilingual_v2\",\n \"stability\": 0.7,\n \"similarityBoost\": 0.85,\n \"speakerBoost\": true,\n \"styleExaggeration\": 0.5,\n \"seed\": 42,\n \"speed\": 1,\n \"applyTextNormalization\": true\n }\n }\n ]\n }\n },\n \"hints\": [\n \"<string>\"\n ],\n \"backgroundSound\": \"enable\",\n \"backgroundSoundVolume\": 50,\n \"ttsCacheEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"assistantBackchannelingEnabled\": false,\n \"dtmfInputEnabled\": false,\n \"maxCallDuration\": 900,\n \"idleTimeout\": 20,\n \"maxIdleMessagesInSequence\": 3,\n \"startSpeakingOptions\": {\n \"waitSeconds\": 0,\n \"smartEndpointing\": \"Interactly\",\n \"onPunctuationSeconds\": 0,\n \"onNoPunctuationSeconds\": 0,\n \"onNumberSeconds\": 0,\n \"LiveKitBaseValue\": 100,\n \"LiveKitScaleValue\": 1000\n },\n \"stopSpeakingOptions\": {\n \"numberOfWords\": 3,\n \"voiceSeconds\": 0\n },\n \"userInterruptionAckPlan\": {\n \"enabled\": true,\n \"count\": 2,\n \"words\": 4,\n \"phrases\": [\n \"Please hold on while I check your account.\",\n \"one moment please\",\n \"let me just check that for you\"\n ]\n },\n \"assistantToolIds\": [],\n \"assistantPredefinedTools\": {\n \"knowledgeBase\": false,\n \"endCall\": false,\n \"appointment\": false,\n \"volumeControl\": false,\n \"waitList\": false,\n \"callForward\": false,\n \"sendSms\": false\n },\n \"assistantType\": \"single_prompt\",\n \"assistantKnowledgeBaseIds\": [],\n \"endCallMessage\": \"Goodbye!\",\n \"endCallToolDescription\": \"Trigger the end call only when the user is done with the conversation.\",\n \"endCallPhrases\": [\n \"goodbye\",\n \"bye\"\n ],\n \"callForwardData\": {\n \"phoneNumber\": \"+1234567890\",\n \"extension\": \"\",\n \"name\": \"call-forward-name\"\n },\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"assistantAnalysis\": {\n \"summary\": {\n \"enabled\": false,\n \"prompt\": \"Generate a summary of the call.\",\n \"timeoutSeconds\": 30\n },\n \"successEvaluation\": {\n \"enabled\": false,\n \"prompt\": \"Evaluate the success of the call.\",\n \"timeoutSeconds\": 30\n },\n \"structuredData\": {\n \"enabled\": false,\n \"prompt\": \"Extract structured data from the call.\",\n \"timeoutSeconds\": 30,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"This is the name of the user.\",\n \"example\": \"John Doe\"\n },\n \"dob\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"This is the date of birth of the user.\",\n \"example\": \"1990-03-08\"\n }\n }\n }\n }\n },\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n },\n \"assistantOutcome\": [\n {\n \"type\": \"<string>\",\n \"field\": \"<string>\"\n }\n ],\n \"smsConfiguration\": {\n \"enabled\": true,\n \"sameAsAssistant\": true,\n \"smsPrompt\": \"<string>\"\n },\n \"persistHistory\": {\n \"enabled\": true,\n \"call\": true,\n \"sms\": true,\n \"retentionPeriod\": 7\n }\n },\n \"assistantId\": \"678a253ca6d866573043502e\",\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "CC-897ee2d4-ea2f-4958-889f-df381bdfc939",
"teamId": "1f7b1b1b1b1b1b1b1b1b1b1b",
"assistantId": "678a253ca6d866573043502e",
"phoneNumberId": "5f7b1b1b1b1b1b1b1b1b1b1b",
"direction": "outbound",
"createdAt": "2020-10-05T00:00:00.000Z",
"updatedAt": "2020-10-05T00:00:00.000Z",
"customer": {
"number": "<string>",
"name": "<string>"
},
"status": "queued",
"metadata": {
"key": "value"
},
"phoneVendor": "twilio",
"phoneVendorDetails": {
"from": "+1234567890",
"to": "+1234567890",
"twiml": "twiml-response-tobe-given-to-twilio",
"responseType": "text/xml",
"statusCallback": "https://<domain>.interactly.ai/voice/twilio/call-status/<call-id>",
"statusCallbackEvent": []
},
"monitor": {
"controlUrl": "https://<domain>.interactly.ai/calls/v1/conversations/<random-id>/control"
}
}Connect Call
Connect your call with Interactly.
curl --request POST \
--url https://api-prod.interactly.ai/calls/v1/conversations/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"direction": "outbound",
"phoneNumberId": "5f7b1b1b1b1b1b1b1b1b1b1b",
"customer": {
"number": "<string>",
"name": "<string>"
},
"metadata": {
"key": "value"
},
"assistant": {
"name": "My Assistant",
"welcomeMessage": "Hello! How can I help you?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"assistantProvider": "openai",
"assistantModel": "gpt-4o-mini",
"assistantLLMUrl": "<string>",
"assistantSystemPrompt": "You are AI assistant to help patients with their health care needs.",
"assistantTemperature": 0,
"assistantMaxTokens": 256,
"assistantResponseSplitter": ",",
"config": {
"speech": {
"stt": {
"vendor": "microsoft",
"languages": "en-US"
},
"sttFallback": {
"enabled": true,
"vendor": "microsoft",
"languages": "en-US"
},
"ttsData": [
{
"enabled": true,
"vendor": "eleven-labs",
"language": "en-US",
"voice": "ZeK6O9RfGNGj0cJT2HoJ",
"config": {
"modelId": "eleven_multilingual_v2",
"stability": 0.7,
"similarityBoost": 0.85,
"speakerBoost": true,
"styleExaggeration": 0.5,
"seed": 42,
"speed": 1,
"applyTextNormalization": true
}
}
]
}
},
"hints": [
"<string>"
],
"backgroundSound": "enable",
"backgroundSoundVolume": 50,
"ttsCacheEnabled": false,
"maxConsecutiveTtsFailures": 2,
"recordingEnabled": true,
"recordAfterTransfer": false,
"postCallTranscriptsEnabled": false,
"assistantBackchannelingEnabled": false,
"dtmfInputEnabled": false,
"maxCallDuration": 900,
"idleTimeout": 20,
"maxIdleMessagesInSequence": 3,
"startSpeakingOptions": {
"waitSeconds": 0,
"smartEndpointing": "Interactly",
"onPunctuationSeconds": 0,
"onNoPunctuationSeconds": 0,
"onNumberSeconds": 0,
"LiveKitBaseValue": 100,
"LiveKitScaleValue": 1000
},
"stopSpeakingOptions": {
"numberOfWords": 3,
"voiceSeconds": 0
},
"userInterruptionAckPlan": {
"enabled": true,
"count": 2,
"words": 4,
"phrases": [
"Please hold on while I check your account.",
"one moment please",
"let me just check that for you"
]
},
"assistantToolIds": [],
"assistantPredefinedTools": {
"knowledgeBase": false,
"endCall": false,
"appointment": false,
"volumeControl": false,
"waitList": false,
"callForward": false,
"sendSms": false
},
"assistantType": "single_prompt",
"assistantKnowledgeBaseIds": [],
"endCallMessage": "Goodbye!",
"endCallToolDescription": "Trigger the end call only when the user is done with the conversation.",
"endCallPhrases": [
"goodbye",
"bye"
],
"callForwardData": {
"phoneNumber": "+1234567890",
"extension": "",
"name": "call-forward-name"
},
"warmTransferEnabled": false,
"warmTransferConversational": false,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"assistantAnalysis": {
"summary": {
"enabled": false,
"prompt": "Generate a summary of the call.",
"timeoutSeconds": 30
},
"successEvaluation": {
"enabled": false,
"prompt": "Evaluate the success of the call.",
"timeoutSeconds": 30
},
"structuredData": {
"enabled": false,
"prompt": "Extract structured data from the call.",
"timeoutSeconds": 30,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "This is the name of the user.",
"example": "John Doe"
},
"dob": {
"type": "string",
"format": "date",
"description": "This is the date of birth of the user.",
"example": "1990-03-08"
}
}
}
}
},
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"recordingEnabled": true,
"recordAfterTransfer": false,
"postCallTranscriptsEnabled": false,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": false,
"warmTransferConversational": false,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
},
"assistantOutcome": [
{
"type": "<string>",
"field": "<string>"
}
],
"smsConfiguration": {
"enabled": true,
"sameAsAssistant": true,
"smsPrompt": "<string>"
},
"persistHistory": {
"enabled": true,
"call": true,
"sms": true,
"retentionPeriod": 7
}
},
"assistantId": "678a253ca6d866573043502e",
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"recordingEnabled": true,
"recordAfterTransfer": false,
"postCallTranscriptsEnabled": false,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": false,
"warmTransferConversational": false,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
}
}
'import requests
url = "https://api-prod.interactly.ai/calls/v1/conversations/connect"
payload = {
"direction": "outbound",
"phoneNumberId": "5f7b1b1b1b1b1b1b1b1b1b1b",
"customer": {
"number": "<string>",
"name": "<string>"
},
"metadata": { "key": "value" },
"assistant": {
"name": "My Assistant",
"welcomeMessage": "Hello! How can I help you?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": False,
"assistantProvider": "openai",
"assistantModel": "gpt-4o-mini",
"assistantLLMUrl": "<string>",
"assistantSystemPrompt": "You are AI assistant to help patients with their health care needs.",
"assistantTemperature": 0,
"assistantMaxTokens": 256,
"assistantResponseSplitter": ",",
"config": { "speech": {
"stt": {
"vendor": "microsoft",
"languages": "en-US"
},
"sttFallback": {
"enabled": True,
"vendor": "microsoft",
"languages": "en-US"
},
"ttsData": [
{
"enabled": True,
"vendor": "eleven-labs",
"language": "en-US",
"voice": "ZeK6O9RfGNGj0cJT2HoJ",
"config": {
"modelId": "eleven_multilingual_v2",
"stability": 0.7,
"similarityBoost": 0.85,
"speakerBoost": True,
"styleExaggeration": 0.5,
"seed": 42,
"speed": 1,
"applyTextNormalization": True
}
}
]
} },
"hints": ["<string>"],
"backgroundSound": "enable",
"backgroundSoundVolume": 50,
"ttsCacheEnabled": False,
"maxConsecutiveTtsFailures": 2,
"recordingEnabled": True,
"recordAfterTransfer": False,
"postCallTranscriptsEnabled": False,
"assistantBackchannelingEnabled": False,
"dtmfInputEnabled": False,
"maxCallDuration": 900,
"idleTimeout": 20,
"maxIdleMessagesInSequence": 3,
"startSpeakingOptions": {
"waitSeconds": 0,
"smartEndpointing": "Interactly",
"onPunctuationSeconds": 0,
"onNoPunctuationSeconds": 0,
"onNumberSeconds": 0,
"LiveKitBaseValue": 100,
"LiveKitScaleValue": 1000
},
"stopSpeakingOptions": {
"numberOfWords": 3,
"voiceSeconds": 0
},
"userInterruptionAckPlan": {
"enabled": True,
"count": 2,
"words": 4,
"phrases": ["Please hold on while I check your account.", "one moment please", "let me just check that for you"]
},
"assistantToolIds": [],
"assistantPredefinedTools": {
"knowledgeBase": False,
"endCall": False,
"appointment": False,
"volumeControl": False,
"waitList": False,
"callForward": False,
"sendSms": False
},
"assistantType": "single_prompt",
"assistantKnowledgeBaseIds": [],
"endCallMessage": "Goodbye!",
"endCallToolDescription": "Trigger the end call only when the user is done with the conversation.",
"endCallPhrases": ["goodbye", "bye"],
"callForwardData": {
"phoneNumber": "+1234567890",
"extension": "",
"name": "call-forward-name"
},
"warmTransferEnabled": False,
"warmTransferConversational": False,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"assistantAnalysis": {
"summary": {
"enabled": False,
"prompt": "Generate a summary of the call.",
"timeoutSeconds": 30
},
"successEvaluation": {
"enabled": False,
"prompt": "Evaluate the success of the call.",
"timeoutSeconds": 30
},
"structuredData": {
"enabled": False,
"prompt": "Extract structured data from the call.",
"timeoutSeconds": 30,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "This is the name of the user.",
"example": "John Doe"
},
"dob": {
"type": "string",
"format": "date",
"description": "This is the date of birth of the user.",
"example": "1990-03-08"
}
}
}
}
},
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": False,
"recordingEnabled": True,
"recordAfterTransfer": False,
"postCallTranscriptsEnabled": False,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": False,
"warmTransferConversational": False,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": { "user_name": "John Doe" }
},
"assistantOutcome": [
{
"type": "<string>",
"field": "<string>"
}
],
"smsConfiguration": {
"enabled": True,
"sameAsAssistant": True,
"smsPrompt": "<string>"
},
"persistHistory": {
"enabled": True,
"call": True,
"sms": True,
"retentionPeriod": 7
}
},
"assistantId": "678a253ca6d866573043502e",
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": False,
"recordingEnabled": True,
"recordAfterTransfer": False,
"postCallTranscriptsEnabled": False,
"maxConsecutiveTtsFailures": 2,
"warmTransferEnabled": False,
"warmTransferConversational": False,
"holdMusicUrl": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
"warmTransferTimeout": 300,
"recordingPath": "/recordings",
"dynamicVariables": { "user_name": "John Doe" }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
direction: 'outbound',
phoneNumberId: '5f7b1b1b1b1b1b1b1b1b1b1b',
customer: {number: '<string>', name: '<string>'},
metadata: {key: 'value'},
assistant: {
name: 'My Assistant',
welcomeMessage: 'Hello! How can I help you?',
welcomeMessageMode: 'assistant-speaks-first',
welcomeMessageInterruptionsEnabled: false,
assistantProvider: 'openai',
assistantModel: 'gpt-4o-mini',
assistantLLMUrl: '<string>',
assistantSystemPrompt: 'You are AI assistant to help patients with their health care needs.',
assistantTemperature: 0,
assistantMaxTokens: 256,
assistantResponseSplitter: ',',
config: {
speech: {
stt: {vendor: 'microsoft', languages: 'en-US'},
sttFallback: {enabled: true, vendor: 'microsoft', languages: 'en-US'},
ttsData: [
{
enabled: true,
vendor: 'eleven-labs',
language: 'en-US',
voice: 'ZeK6O9RfGNGj0cJT2HoJ',
config: {
modelId: 'eleven_multilingual_v2',
stability: 0.7,
similarityBoost: 0.85,
speakerBoost: true,
styleExaggeration: 0.5,
seed: 42,
speed: 1,
applyTextNormalization: true
}
}
]
}
},
hints: ['<string>'],
backgroundSound: 'enable',
backgroundSoundVolume: 50,
ttsCacheEnabled: false,
maxConsecutiveTtsFailures: 2,
recordingEnabled: true,
recordAfterTransfer: false,
postCallTranscriptsEnabled: false,
assistantBackchannelingEnabled: false,
dtmfInputEnabled: false,
maxCallDuration: 900,
idleTimeout: 20,
maxIdleMessagesInSequence: 3,
startSpeakingOptions: {
waitSeconds: 0,
smartEndpointing: 'Interactly',
onPunctuationSeconds: 0,
onNoPunctuationSeconds: 0,
onNumberSeconds: 0,
LiveKitBaseValue: 100,
LiveKitScaleValue: 1000
},
stopSpeakingOptions: {numberOfWords: 3, voiceSeconds: 0},
userInterruptionAckPlan: {
enabled: true,
count: 2,
words: 4,
phrases: [
'Please hold on while I check your account.',
'one moment please',
'let me just check that for you'
]
},
assistantToolIds: [],
assistantPredefinedTools: {
knowledgeBase: false,
endCall: false,
appointment: false,
volumeControl: false,
waitList: false,
callForward: false,
sendSms: false
},
assistantType: 'single_prompt',
assistantKnowledgeBaseIds: [],
endCallMessage: 'Goodbye!',
endCallToolDescription: 'Trigger the end call only when the user is done with the conversation.',
endCallPhrases: ['goodbye', 'bye'],
callForwardData: {phoneNumber: '+1234567890', extension: '', name: 'call-forward-name'},
warmTransferEnabled: false,
warmTransferConversational: false,
holdMusicUrl: 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
warmTransferTimeout: 300,
assistantAnalysis: {
summary: {enabled: false, prompt: 'Generate a summary of the call.', timeoutSeconds: 30},
successEvaluation: {
enabled: false,
prompt: 'Evaluate the success of the call.',
timeoutSeconds: 30
},
structuredData: {
enabled: false,
prompt: 'Extract structured data from the call.',
timeoutSeconds: 30,
schema: {
type: 'object',
properties: {
name: {
type: 'string',
description: 'This is the name of the user.',
example: 'John Doe'
},
dob: {
type: 'string',
format: 'date',
description: 'This is the date of birth of the user.',
example: '1990-03-08'
}
}
}
}
},
assistantOverrides: {
welcomeMessage: 'Hello, how can I help you today?',
welcomeMessageMode: 'assistant-speaks-first',
welcomeMessageInterruptionsEnabled: false,
recordingEnabled: true,
recordAfterTransfer: false,
postCallTranscriptsEnabled: false,
maxConsecutiveTtsFailures: 2,
warmTransferEnabled: false,
warmTransferConversational: false,
holdMusicUrl: 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
warmTransferTimeout: 300,
recordingPath: '/recordings',
dynamicVariables: {user_name: 'John Doe'}
},
assistantOutcome: [{type: '<string>', field: '<string>'}],
smsConfiguration: {enabled: true, sameAsAssistant: true, smsPrompt: '<string>'},
persistHistory: {enabled: true, call: true, sms: true, retentionPeriod: 7}
},
assistantId: '678a253ca6d866573043502e',
assistantOverrides: {
welcomeMessage: 'Hello, how can I help you today?',
welcomeMessageMode: 'assistant-speaks-first',
welcomeMessageInterruptionsEnabled: false,
recordingEnabled: true,
recordAfterTransfer: false,
postCallTranscriptsEnabled: false,
maxConsecutiveTtsFailures: 2,
warmTransferEnabled: false,
warmTransferConversational: false,
holdMusicUrl: 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
warmTransferTimeout: 300,
recordingPath: '/recordings',
dynamicVariables: {user_name: 'John Doe'}
}
})
};
fetch('https://api-prod.interactly.ai/calls/v1/conversations/connect', 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-prod.interactly.ai/calls/v1/conversations/connect",
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([
'direction' => 'outbound',
'phoneNumberId' => '5f7b1b1b1b1b1b1b1b1b1b1b',
'customer' => [
'number' => '<string>',
'name' => '<string>'
],
'metadata' => [
'key' => 'value'
],
'assistant' => [
'name' => 'My Assistant',
'welcomeMessage' => 'Hello! How can I help you?',
'welcomeMessageMode' => 'assistant-speaks-first',
'welcomeMessageInterruptionsEnabled' => false,
'assistantProvider' => 'openai',
'assistantModel' => 'gpt-4o-mini',
'assistantLLMUrl' => '<string>',
'assistantSystemPrompt' => 'You are AI assistant to help patients with their health care needs.',
'assistantTemperature' => 0,
'assistantMaxTokens' => 256,
'assistantResponseSplitter' => ',',
'config' => [
'speech' => [
'stt' => [
'vendor' => 'microsoft',
'languages' => 'en-US'
],
'sttFallback' => [
'enabled' => true,
'vendor' => 'microsoft',
'languages' => 'en-US'
],
'ttsData' => [
[
'enabled' => true,
'vendor' => 'eleven-labs',
'language' => 'en-US',
'voice' => 'ZeK6O9RfGNGj0cJT2HoJ',
'config' => [
'modelId' => 'eleven_multilingual_v2',
'stability' => 0.7,
'similarityBoost' => 0.85,
'speakerBoost' => true,
'styleExaggeration' => 0.5,
'seed' => 42,
'speed' => 1,
'applyTextNormalization' => true
]
]
]
]
],
'hints' => [
'<string>'
],
'backgroundSound' => 'enable',
'backgroundSoundVolume' => 50,
'ttsCacheEnabled' => false,
'maxConsecutiveTtsFailures' => 2,
'recordingEnabled' => true,
'recordAfterTransfer' => false,
'postCallTranscriptsEnabled' => false,
'assistantBackchannelingEnabled' => false,
'dtmfInputEnabled' => false,
'maxCallDuration' => 900,
'idleTimeout' => 20,
'maxIdleMessagesInSequence' => 3,
'startSpeakingOptions' => [
'waitSeconds' => 0,
'smartEndpointing' => 'Interactly',
'onPunctuationSeconds' => 0,
'onNoPunctuationSeconds' => 0,
'onNumberSeconds' => 0,
'LiveKitBaseValue' => 100,
'LiveKitScaleValue' => 1000
],
'stopSpeakingOptions' => [
'numberOfWords' => 3,
'voiceSeconds' => 0
],
'userInterruptionAckPlan' => [
'enabled' => true,
'count' => 2,
'words' => 4,
'phrases' => [
'Please hold on while I check your account.',
'one moment please',
'let me just check that for you'
]
],
'assistantToolIds' => [
],
'assistantPredefinedTools' => [
'knowledgeBase' => false,
'endCall' => false,
'appointment' => false,
'volumeControl' => false,
'waitList' => false,
'callForward' => false,
'sendSms' => false
],
'assistantType' => 'single_prompt',
'assistantKnowledgeBaseIds' => [
],
'endCallMessage' => 'Goodbye!',
'endCallToolDescription' => 'Trigger the end call only when the user is done with the conversation.',
'endCallPhrases' => [
'goodbye',
'bye'
],
'callForwardData' => [
'phoneNumber' => '+1234567890',
'extension' => '',
'name' => 'call-forward-name'
],
'warmTransferEnabled' => false,
'warmTransferConversational' => false,
'holdMusicUrl' => 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
'warmTransferTimeout' => 300,
'assistantAnalysis' => [
'summary' => [
'enabled' => false,
'prompt' => 'Generate a summary of the call.',
'timeoutSeconds' => 30
],
'successEvaluation' => [
'enabled' => false,
'prompt' => 'Evaluate the success of the call.',
'timeoutSeconds' => 30
],
'structuredData' => [
'enabled' => false,
'prompt' => 'Extract structured data from the call.',
'timeoutSeconds' => 30,
'schema' => [
'type' => 'object',
'properties' => [
'name' => [
'type' => 'string',
'description' => 'This is the name of the user.',
'example' => 'John Doe'
],
'dob' => [
'type' => 'string',
'format' => 'date',
'description' => 'This is the date of birth of the user.',
'example' => '1990-03-08'
]
]
]
]
],
'assistantOverrides' => [
'welcomeMessage' => 'Hello, how can I help you today?',
'welcomeMessageMode' => 'assistant-speaks-first',
'welcomeMessageInterruptionsEnabled' => false,
'recordingEnabled' => true,
'recordAfterTransfer' => false,
'postCallTranscriptsEnabled' => false,
'maxConsecutiveTtsFailures' => 2,
'warmTransferEnabled' => false,
'warmTransferConversational' => false,
'holdMusicUrl' => 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
'warmTransferTimeout' => 300,
'recordingPath' => '/recordings',
'dynamicVariables' => [
'user_name' => 'John Doe'
]
],
'assistantOutcome' => [
[
'type' => '<string>',
'field' => '<string>'
]
],
'smsConfiguration' => [
'enabled' => true,
'sameAsAssistant' => true,
'smsPrompt' => '<string>'
],
'persistHistory' => [
'enabled' => true,
'call' => true,
'sms' => true,
'retentionPeriod' => 7
]
],
'assistantId' => '678a253ca6d866573043502e',
'assistantOverrides' => [
'welcomeMessage' => 'Hello, how can I help you today?',
'welcomeMessageMode' => 'assistant-speaks-first',
'welcomeMessageInterruptionsEnabled' => false,
'recordingEnabled' => true,
'recordAfterTransfer' => false,
'postCallTranscriptsEnabled' => false,
'maxConsecutiveTtsFailures' => 2,
'warmTransferEnabled' => false,
'warmTransferConversational' => false,
'holdMusicUrl' => 'https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3',
'warmTransferTimeout' => 300,
'recordingPath' => '/recordings',
'dynamicVariables' => [
'user_name' => 'John Doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-prod.interactly.ai/calls/v1/conversations/connect"
payload := strings.NewReader("{\n \"direction\": \"outbound\",\n \"phoneNumberId\": \"5f7b1b1b1b1b1b1b1b1b1b1b\",\n \"customer\": {\n \"number\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"metadata\": {\n \"key\": \"value\"\n },\n \"assistant\": {\n \"name\": \"My Assistant\",\n \"welcomeMessage\": \"Hello! How can I help you?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"assistantProvider\": \"openai\",\n \"assistantModel\": \"gpt-4o-mini\",\n \"assistantLLMUrl\": \"<string>\",\n \"assistantSystemPrompt\": \"You are AI assistant to help patients with their health care needs.\",\n \"assistantTemperature\": 0,\n \"assistantMaxTokens\": 256,\n \"assistantResponseSplitter\": \",\",\n \"config\": {\n \"speech\": {\n \"stt\": {\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"sttFallback\": {\n \"enabled\": true,\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"ttsData\": [\n {\n \"enabled\": true,\n \"vendor\": \"eleven-labs\",\n \"language\": \"en-US\",\n \"voice\": \"ZeK6O9RfGNGj0cJT2HoJ\",\n \"config\": {\n \"modelId\": \"eleven_multilingual_v2\",\n \"stability\": 0.7,\n \"similarityBoost\": 0.85,\n \"speakerBoost\": true,\n \"styleExaggeration\": 0.5,\n \"seed\": 42,\n \"speed\": 1,\n \"applyTextNormalization\": true\n }\n }\n ]\n }\n },\n \"hints\": [\n \"<string>\"\n ],\n \"backgroundSound\": \"enable\",\n \"backgroundSoundVolume\": 50,\n \"ttsCacheEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"assistantBackchannelingEnabled\": false,\n \"dtmfInputEnabled\": false,\n \"maxCallDuration\": 900,\n \"idleTimeout\": 20,\n \"maxIdleMessagesInSequence\": 3,\n \"startSpeakingOptions\": {\n \"waitSeconds\": 0,\n \"smartEndpointing\": \"Interactly\",\n \"onPunctuationSeconds\": 0,\n \"onNoPunctuationSeconds\": 0,\n \"onNumberSeconds\": 0,\n \"LiveKitBaseValue\": 100,\n \"LiveKitScaleValue\": 1000\n },\n \"stopSpeakingOptions\": {\n \"numberOfWords\": 3,\n \"voiceSeconds\": 0\n },\n \"userInterruptionAckPlan\": {\n \"enabled\": true,\n \"count\": 2,\n \"words\": 4,\n \"phrases\": [\n \"Please hold on while I check your account.\",\n \"one moment please\",\n \"let me just check that for you\"\n ]\n },\n \"assistantToolIds\": [],\n \"assistantPredefinedTools\": {\n \"knowledgeBase\": false,\n \"endCall\": false,\n \"appointment\": false,\n \"volumeControl\": false,\n \"waitList\": false,\n \"callForward\": false,\n \"sendSms\": false\n },\n \"assistantType\": \"single_prompt\",\n \"assistantKnowledgeBaseIds\": [],\n \"endCallMessage\": \"Goodbye!\",\n \"endCallToolDescription\": \"Trigger the end call only when the user is done with the conversation.\",\n \"endCallPhrases\": [\n \"goodbye\",\n \"bye\"\n ],\n \"callForwardData\": {\n \"phoneNumber\": \"+1234567890\",\n \"extension\": \"\",\n \"name\": \"call-forward-name\"\n },\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"assistantAnalysis\": {\n \"summary\": {\n \"enabled\": false,\n \"prompt\": \"Generate a summary of the call.\",\n \"timeoutSeconds\": 30\n },\n \"successEvaluation\": {\n \"enabled\": false,\n \"prompt\": \"Evaluate the success of the call.\",\n \"timeoutSeconds\": 30\n },\n \"structuredData\": {\n \"enabled\": false,\n \"prompt\": \"Extract structured data from the call.\",\n \"timeoutSeconds\": 30,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"This is the name of the user.\",\n \"example\": \"John Doe\"\n },\n \"dob\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"This is the date of birth of the user.\",\n \"example\": \"1990-03-08\"\n }\n }\n }\n }\n },\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n },\n \"assistantOutcome\": [\n {\n \"type\": \"<string>\",\n \"field\": \"<string>\"\n }\n ],\n \"smsConfiguration\": {\n \"enabled\": true,\n \"sameAsAssistant\": true,\n \"smsPrompt\": \"<string>\"\n },\n \"persistHistory\": {\n \"enabled\": true,\n \"call\": true,\n \"sms\": true,\n \"retentionPeriod\": 7\n }\n },\n \"assistantId\": \"678a253ca6d866573043502e\",\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-prod.interactly.ai/calls/v1/conversations/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"direction\": \"outbound\",\n \"phoneNumberId\": \"5f7b1b1b1b1b1b1b1b1b1b1b\",\n \"customer\": {\n \"number\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"metadata\": {\n \"key\": \"value\"\n },\n \"assistant\": {\n \"name\": \"My Assistant\",\n \"welcomeMessage\": \"Hello! How can I help you?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"assistantProvider\": \"openai\",\n \"assistantModel\": \"gpt-4o-mini\",\n \"assistantLLMUrl\": \"<string>\",\n \"assistantSystemPrompt\": \"You are AI assistant to help patients with their health care needs.\",\n \"assistantTemperature\": 0,\n \"assistantMaxTokens\": 256,\n \"assistantResponseSplitter\": \",\",\n \"config\": {\n \"speech\": {\n \"stt\": {\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"sttFallback\": {\n \"enabled\": true,\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"ttsData\": [\n {\n \"enabled\": true,\n \"vendor\": \"eleven-labs\",\n \"language\": \"en-US\",\n \"voice\": \"ZeK6O9RfGNGj0cJT2HoJ\",\n \"config\": {\n \"modelId\": \"eleven_multilingual_v2\",\n \"stability\": 0.7,\n \"similarityBoost\": 0.85,\n \"speakerBoost\": true,\n \"styleExaggeration\": 0.5,\n \"seed\": 42,\n \"speed\": 1,\n \"applyTextNormalization\": true\n }\n }\n ]\n }\n },\n \"hints\": [\n \"<string>\"\n ],\n \"backgroundSound\": \"enable\",\n \"backgroundSoundVolume\": 50,\n \"ttsCacheEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"assistantBackchannelingEnabled\": false,\n \"dtmfInputEnabled\": false,\n \"maxCallDuration\": 900,\n \"idleTimeout\": 20,\n \"maxIdleMessagesInSequence\": 3,\n \"startSpeakingOptions\": {\n \"waitSeconds\": 0,\n \"smartEndpointing\": \"Interactly\",\n \"onPunctuationSeconds\": 0,\n \"onNoPunctuationSeconds\": 0,\n \"onNumberSeconds\": 0,\n \"LiveKitBaseValue\": 100,\n \"LiveKitScaleValue\": 1000\n },\n \"stopSpeakingOptions\": {\n \"numberOfWords\": 3,\n \"voiceSeconds\": 0\n },\n \"userInterruptionAckPlan\": {\n \"enabled\": true,\n \"count\": 2,\n \"words\": 4,\n \"phrases\": [\n \"Please hold on while I check your account.\",\n \"one moment please\",\n \"let me just check that for you\"\n ]\n },\n \"assistantToolIds\": [],\n \"assistantPredefinedTools\": {\n \"knowledgeBase\": false,\n \"endCall\": false,\n \"appointment\": false,\n \"volumeControl\": false,\n \"waitList\": false,\n \"callForward\": false,\n \"sendSms\": false\n },\n \"assistantType\": \"single_prompt\",\n \"assistantKnowledgeBaseIds\": [],\n \"endCallMessage\": \"Goodbye!\",\n \"endCallToolDescription\": \"Trigger the end call only when the user is done with the conversation.\",\n \"endCallPhrases\": [\n \"goodbye\",\n \"bye\"\n ],\n \"callForwardData\": {\n \"phoneNumber\": \"+1234567890\",\n \"extension\": \"\",\n \"name\": \"call-forward-name\"\n },\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"assistantAnalysis\": {\n \"summary\": {\n \"enabled\": false,\n \"prompt\": \"Generate a summary of the call.\",\n \"timeoutSeconds\": 30\n },\n \"successEvaluation\": {\n \"enabled\": false,\n \"prompt\": \"Evaluate the success of the call.\",\n \"timeoutSeconds\": 30\n },\n \"structuredData\": {\n \"enabled\": false,\n \"prompt\": \"Extract structured data from the call.\",\n \"timeoutSeconds\": 30,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"This is the name of the user.\",\n \"example\": \"John Doe\"\n },\n \"dob\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"This is the date of birth of the user.\",\n \"example\": \"1990-03-08\"\n }\n }\n }\n }\n },\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n },\n \"assistantOutcome\": [\n {\n \"type\": \"<string>\",\n \"field\": \"<string>\"\n }\n ],\n \"smsConfiguration\": {\n \"enabled\": true,\n \"sameAsAssistant\": true,\n \"smsPrompt\": \"<string>\"\n },\n \"persistHistory\": {\n \"enabled\": true,\n \"call\": true,\n \"sms\": true,\n \"retentionPeriod\": 7\n }\n },\n \"assistantId\": \"678a253ca6d866573043502e\",\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.interactly.ai/calls/v1/conversations/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"direction\": \"outbound\",\n \"phoneNumberId\": \"5f7b1b1b1b1b1b1b1b1b1b1b\",\n \"customer\": {\n \"number\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"metadata\": {\n \"key\": \"value\"\n },\n \"assistant\": {\n \"name\": \"My Assistant\",\n \"welcomeMessage\": \"Hello! How can I help you?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"assistantProvider\": \"openai\",\n \"assistantModel\": \"gpt-4o-mini\",\n \"assistantLLMUrl\": \"<string>\",\n \"assistantSystemPrompt\": \"You are AI assistant to help patients with their health care needs.\",\n \"assistantTemperature\": 0,\n \"assistantMaxTokens\": 256,\n \"assistantResponseSplitter\": \",\",\n \"config\": {\n \"speech\": {\n \"stt\": {\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"sttFallback\": {\n \"enabled\": true,\n \"vendor\": \"microsoft\",\n \"languages\": \"en-US\"\n },\n \"ttsData\": [\n {\n \"enabled\": true,\n \"vendor\": \"eleven-labs\",\n \"language\": \"en-US\",\n \"voice\": \"ZeK6O9RfGNGj0cJT2HoJ\",\n \"config\": {\n \"modelId\": \"eleven_multilingual_v2\",\n \"stability\": 0.7,\n \"similarityBoost\": 0.85,\n \"speakerBoost\": true,\n \"styleExaggeration\": 0.5,\n \"seed\": 42,\n \"speed\": 1,\n \"applyTextNormalization\": true\n }\n }\n ]\n }\n },\n \"hints\": [\n \"<string>\"\n ],\n \"backgroundSound\": \"enable\",\n \"backgroundSoundVolume\": 50,\n \"ttsCacheEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"assistantBackchannelingEnabled\": false,\n \"dtmfInputEnabled\": false,\n \"maxCallDuration\": 900,\n \"idleTimeout\": 20,\n \"maxIdleMessagesInSequence\": 3,\n \"startSpeakingOptions\": {\n \"waitSeconds\": 0,\n \"smartEndpointing\": \"Interactly\",\n \"onPunctuationSeconds\": 0,\n \"onNoPunctuationSeconds\": 0,\n \"onNumberSeconds\": 0,\n \"LiveKitBaseValue\": 100,\n \"LiveKitScaleValue\": 1000\n },\n \"stopSpeakingOptions\": {\n \"numberOfWords\": 3,\n \"voiceSeconds\": 0\n },\n \"userInterruptionAckPlan\": {\n \"enabled\": true,\n \"count\": 2,\n \"words\": 4,\n \"phrases\": [\n \"Please hold on while I check your account.\",\n \"one moment please\",\n \"let me just check that for you\"\n ]\n },\n \"assistantToolIds\": [],\n \"assistantPredefinedTools\": {\n \"knowledgeBase\": false,\n \"endCall\": false,\n \"appointment\": false,\n \"volumeControl\": false,\n \"waitList\": false,\n \"callForward\": false,\n \"sendSms\": false\n },\n \"assistantType\": \"single_prompt\",\n \"assistantKnowledgeBaseIds\": [],\n \"endCallMessage\": \"Goodbye!\",\n \"endCallToolDescription\": \"Trigger the end call only when the user is done with the conversation.\",\n \"endCallPhrases\": [\n \"goodbye\",\n \"bye\"\n ],\n \"callForwardData\": {\n \"phoneNumber\": \"+1234567890\",\n \"extension\": \"\",\n \"name\": \"call-forward-name\"\n },\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"assistantAnalysis\": {\n \"summary\": {\n \"enabled\": false,\n \"prompt\": \"Generate a summary of the call.\",\n \"timeoutSeconds\": 30\n },\n \"successEvaluation\": {\n \"enabled\": false,\n \"prompt\": \"Evaluate the success of the call.\",\n \"timeoutSeconds\": 30\n },\n \"structuredData\": {\n \"enabled\": false,\n \"prompt\": \"Extract structured data from the call.\",\n \"timeoutSeconds\": 30,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"This is the name of the user.\",\n \"example\": \"John Doe\"\n },\n \"dob\": {\n \"type\": \"string\",\n \"format\": \"date\",\n \"description\": \"This is the date of birth of the user.\",\n \"example\": \"1990-03-08\"\n }\n }\n }\n }\n },\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n },\n \"assistantOutcome\": [\n {\n \"type\": \"<string>\",\n \"field\": \"<string>\"\n }\n ],\n \"smsConfiguration\": {\n \"enabled\": true,\n \"sameAsAssistant\": true,\n \"smsPrompt\": \"<string>\"\n },\n \"persistHistory\": {\n \"enabled\": true,\n \"call\": true,\n \"sms\": true,\n \"retentionPeriod\": 7\n }\n },\n \"assistantId\": \"678a253ca6d866573043502e\",\n \"assistantOverrides\": {\n \"welcomeMessage\": \"Hello, how can I help you today?\",\n \"welcomeMessageMode\": \"assistant-speaks-first\",\n \"welcomeMessageInterruptionsEnabled\": false,\n \"recordingEnabled\": true,\n \"recordAfterTransfer\": false,\n \"postCallTranscriptsEnabled\": false,\n \"maxConsecutiveTtsFailures\": 2,\n \"warmTransferEnabled\": false,\n \"warmTransferConversational\": false,\n \"holdMusicUrl\": \"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3\",\n \"warmTransferTimeout\": 300,\n \"recordingPath\": \"/recordings\",\n \"dynamicVariables\": {\n \"user_name\": \"John Doe\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "CC-897ee2d4-ea2f-4958-889f-df381bdfc939",
"teamId": "1f7b1b1b1b1b1b1b1b1b1b1b",
"assistantId": "678a253ca6d866573043502e",
"phoneNumberId": "5f7b1b1b1b1b1b1b1b1b1b1b",
"direction": "outbound",
"createdAt": "2020-10-05T00:00:00.000Z",
"updatedAt": "2020-10-05T00:00:00.000Z",
"customer": {
"number": "<string>",
"name": "<string>"
},
"status": "queued",
"metadata": {
"key": "value"
},
"phoneVendor": "twilio",
"phoneVendorDetails": {
"from": "+1234567890",
"to": "+1234567890",
"twiml": "twiml-response-tobe-given-to-twilio",
"responseType": "text/xml",
"statusCallback": "https://<domain>.interactly.ai/voice/twilio/call-status/<call-id>",
"statusCallbackEvent": []
},
"monitor": {
"controlUrl": "https://<domain>.interactly.ai/calls/v1/conversations/<random-id>/control"
}
}Authorizations
Retrieve your API Key from Dashboard API Keys Section.
Body
This is the direction of the conversation.
Inbound - The conversation is initiated by the user. Outbound - The conversation is initiated by the assistant.
inbound, outbound "outbound"
Unique phone number ID. This is the phone number that will be used to make the call.
"5f7b1b1b1b1b1b1b1b1b1b1b"
This is the customer object. It contains all the information about the customer.
Show child attributes
Show child attributes
This is the metadata of the conversation. You can add any additional information here.
{ "key": "value" }
This is the assistant that will be used for the call. To use an existing assistant, use assistantId instead.
If both assistant and assistantId are provided, only assistant will be used for this conversation. If both assistant and assistantId are not provided, the default assistant that is attached to phone number will be used for the call.
Show child attributes
Show child attributes
This is the ID of the assistant that will be used for the conversation. If you already have an assistant, you can use this field to specify the assistantId instead of giving all the assistant configuration in the assistant object.
"678a253ca6d866573043502e"
This is where you can override the default behavior of the assistant.
Show child attributes
Show child attributes
Response
Successful response
This is the unique identifier of the call.
"CC-897ee2d4-ea2f-4958-889f-df381bdfc939"
This is the unique identifier of the team that the call belongs to.
"1f7b1b1b1b1b1b1b1b1b1b1b"
ID of the assistant that will be used for the call.
"678a253ca6d866573043502e"
Unique phone number ID. This is the phone number that will be used to make the call.
"5f7b1b1b1b1b1b1b1b1b1b1b"
This is the direction of the conversation.
Inbound - The conversation is initiated by the user. Outbound - The conversation is initiated by the assistant.
inbound, outbound "outbound"
This is the ISO 8601 date-time string of when the record was created.
"2020-10-05T00:00:00.000Z"
This is the ISO 8601 date-time string of when the record was last updated.
"2020-10-05T00:00:00.000Z"
Show child attributes
Show child attributes
This is the status of the call.
queued, ongoing, completed, forwarded "queued"
This is the metadata of the conversation. You can add any additional information here.
{ "key": "value" }
This is the vendor of the phone number.
twilio, bandwidth "twilio"
This is the vendor details of the phone number.
Show child attributes
Show child attributes
To monitor and control the conversation
Show child attributes
Show child attributes