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"
},
"ttsData": [
{
"vendor": "eleven-labs",
"language": "en-US",
"voice": "ZeK6O9RfGNGj0cJT2HoJ"
}
]
}
},
"hints": [
"<string>"
],
"backgroundSound": "enable",
"backgroundSoundVolume": 50,
"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
},
"assistantToolIds": [],
"assistantPredefinedTools": {
"knowledgeBase": false,
"endCall": false,
"appointment": false,
"volumeControl": false,
"waitList": false,
"callForward": false
},
"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"
},
"assistantAnalysis": {
"summary": {
"enabled": false,
"prompt": "Generate a summary of the call.",
"timeoutSeconds": 30
},
"successEvaluation": {
"enabled": false,
"prompt": "Evaluate the success of the call.",
"rubric": "NumericScale",
"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,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
},
"assistantServer": {
"url": "https://api.example.com/v1/getUserDetails",
"timeoutSeconds": 20,
"secret": "my-secret",
"headers": {},
"enabled": false,
"messages": [
"status-update",
"conversation-update",
"hang",
"end-of-call-report"
]
}
},
"assistantId": "678a253ca6d866573043502e",
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"recordingEnabled": true,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
}
}
'{
"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": [
"initiated"
]
},
"monitor": {
"controlUrl": "https://<domain>.interactly.ai/calls/v1/conversations/<random-id>/control"
}
}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"
},
"ttsData": [
{
"vendor": "eleven-labs",
"language": "en-US",
"voice": "ZeK6O9RfGNGj0cJT2HoJ"
}
]
}
},
"hints": [
"<string>"
],
"backgroundSound": "enable",
"backgroundSoundVolume": 50,
"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
},
"assistantToolIds": [],
"assistantPredefinedTools": {
"knowledgeBase": false,
"endCall": false,
"appointment": false,
"volumeControl": false,
"waitList": false,
"callForward": false
},
"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"
},
"assistantAnalysis": {
"summary": {
"enabled": false,
"prompt": "Generate a summary of the call.",
"timeoutSeconds": 30
},
"successEvaluation": {
"enabled": false,
"prompt": "Evaluate the success of the call.",
"rubric": "NumericScale",
"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,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
},
"assistantServer": {
"url": "https://api.example.com/v1/getUserDetails",
"timeoutSeconds": 20,
"secret": "my-secret",
"headers": {},
"enabled": false,
"messages": [
"status-update",
"conversation-update",
"hang",
"end-of-call-report"
]
}
},
"assistantId": "678a253ca6d866573043502e",
"assistantOverrides": {
"welcomeMessage": "Hello, how can I help you today?",
"welcomeMessageMode": "assistant-speaks-first",
"welcomeMessageInterruptionsEnabled": false,
"recordingEnabled": true,
"recordingPath": "/recordings",
"dynamicVariables": {
"user_name": "John Doe"
}
}
}
'{
"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": [
"initiated"
]
},
"monitor": {
"controlUrl": "https://<domain>.interactly.ai/calls/v1/conversations/<random-id>/control"
}
}Retrieve your API Key from Dashboard API Keys Section.
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 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
This is the name of the assistant.
"My Assistant"
This is the welcome message of the assistant.
"Hello! How can I help you?"
This is the mode of the welcome message. It can be one of the following: 'assistant-speaks-first', 'assistant-waits-for-user', 'automatic'.
"assistant-speaks-first"
This is a boolean that controls whether the interruptions are enabled during the welcome message. If set to false, the user can not interrupt the welcome message.
false
This is the provider of the assistant.
openai, azure, gemini, deepseek, bedrock, custom-llm "openai"
The type of model used for the assistant depends on the provider.
For openai - Available Options: gpt-4, gpt-4o, gpt-4o-mini, gpt-3.5-turbo.
For azure - Available Options: gpt-4, gpt-4o, gpt-4o-mini.
For gemini - Available Options: gemini-1.5-flash-latest,gemini-1.5-pro-latest,gemini-1.5-flash.
For deepseek - Available Options: V3.
For bedrock - Available Options: anthropic.claude-3-5-sonnet, anthropic.claude-3-5-haiku, meta.llama3-1-8b-instruct.
"gpt-4o-mini"
Provider your LLM Base URL here when assistantProvider=custom-llm.
Ex: https://your-server.com/custom-llm.
Please note that, we will append /chat/completions to your base URL before calling LLM endpoints.
The LLM URL should be accessible from the Interactly server.
If you are using a local server, you can use ngrok to expose your local server to the internet.
This system prompt guides the assistant's operations.
"You are AI assistant to help patients with their health care needs."
This is the temperature of the assistant.
0
This is the maximum number of tokens that the assistant can generate.
256
Use this Delimiter to split the AI responses into separate lines.
","
This is the stt and tts configuration of the assistant. You can add one stt and multiple tts configurations.
Show child attributes
Show child attributes
This section allows you to configure the transcription settings for the assistant.
Show child attributes
This is the vendor of the speech to text.
microsoft "microsoft"
This is the list of languages that the assistant can understand.
en-US, en-IN, en-GB, es-US, es-MX, fr-FR, fr-CA, zh-CN, pt-BR, pt-PT, hi-IN "en-US"
This is the text to speech configuration of the assistant. You can add multiple tts configurations.
Show child attributes
eleven-labs "eleven-labs"
This is the language of the text to speech.
en-US, es-US, fr-FR, zh-CN, hi-IN "en-US"
Provider voice ID. Ex: Voice ID will be ZeK6O9RfGNGj0cJT2HoJ for Shanaya (female)-Customer Care Agent voice.
"ZeK6O9RfGNGj0cJT2HoJ"
Provide keyword hints to help the assistant better recognize and transcribe important words or phrases.
This is the background sound in the call. Default is 'disable'. You can also provide a custom sound by providing a URL to an audio file. URL should be publicly accessible and should starts with https:// only.
Note: Currently custom sound is not supported in twilio phone vendor.
enable, disable 1000"enable"
This is the volume of the background sound. It is a number between 1 and 100.
50
This is the backchanneling enabled of the assistant.
false
This is a boolean that controls whether the DTMF input is enabled for the assistant.
false
This is the max call duration(in minutes) of the assistant.
1 <= x <= 120900
How long should the assistant wait in silence before confirming the user's presence and playing an idle message?
5 <= x <= 60020
Maximum number of times to repeat the idle message in sequence
1 <= x <= 53
Configuration for when the assistant should start talking.
Show child attributes
Number of seconds to wait before starting to process speech
Controls the endpointing strategy for detecting when a user has finished speaking
Interactly, Off, LiveKit The minimum number of seconds to wait after transcription ending with punctuation before sending a request to the model.
This is only used if smartEndpointing is set to Off.
The minimum number of seconds to wait after transcription ending without punctuation before sending a request to the model.
This is only used if smartEndpointing is set to Off.
The minimum number of seconds to wait after transcription ending with a number before sending a request to the model.
This is only used if smartEndpointing is set to Off.
In the expression where X is the probability that the user is still speaking:
LiveKitBaseValue + (LiveKitScaleValue * X)
This is the base timeout value in milliseconds.
This is only used if smartEndpointing is set to LiveKit.
In the expression where X is the probability that the user is still speaking:
LiveKitBaseValue + (LiveKitScaleValue * X)
This is the scaling factor for LiveKit endpointing that adjusts based on speech probability.
This is only used if smartEndpointing is set to LiveKit.
Configuration for detecting when when assistant should stop talking on customer interruption.
Show child attributes
This is the number of words that the customer has to say before the assistant will stop talking.
This is the seconds customer has to speak before the assistant stops talking. This uses the VAD (Voice Activity Detection) spike to determine if the customer has started speaking.
This is the list of tool IDs of the assistant.
[]Enable or disable specific tools that the assistant can use to improve its functionality.
Show child attributes
This will allow the assistant to end the call from its side.
This will allow the assistant to end the call from its side.
This will allow the assistant to manage appointments, including scheduling, rescheduling, and cancellations.
This will allow the assistant to adjust the call volume.
This will allow the assistant to access the wait list.
This will allow the assistant to forward calls to the desired recipient or queue.
This is the list of knowledge base IDs of the assistant. Provide only when assistantPredefinedTools.knowledgeBase is enabled
[]This is the message that the assistant will say if it ends the call. Provide only when assistantPredefinedTools.endCall is enabled
"Goodbye!"
This is the description of the tool that the assistant will use to end the call. Provide only when assistantPredefinedTools.endCall is enabled
"Trigger the end call only when the user is done with the conversation."
List of phrases that the assistant will listen to end the call. Provide only when assistantPredefinedTools.endCall is enabled
["goodbye", "bye"]This is the call-forwarding data of the assistant.
Show child attributes
Phone number used to forward the call.
"+1234567890"
This is the extension of the assistant. Leave it empty if there is no extension.
""
This is a friendly name for the call forward.
"call-forward-name"
{
"phoneNumber": "+1234567890",
"extension": "",
"name": "call-forward-name"
}Show child attributes
This is the plan for generating the summary of the call. This outputs to call.analysis.summary.
Show child attributes
This is a boolean that controls whether the summary is generated. If set to false, the model will not generate a summary of the call.
@default false
false
This is the prompt that the model will use to generate the summary of the call.
"Generate a summary of the call."
This is how long the request is tried before giving up. When request times out, call.analysis.summary will be empty.
Usage:
1 <= x <= 6030
This is the plan for generating the success evaluation of the call. This outputs to call.analysis.successEvaluation.
Show child attributes
This is a boolean that controls whether the success evaluation is generated. If set to false, the model will not generate a success evaluation of the call.
@default false
false
This is the prompt that the model will use to generate the success evaluation of the call.
"Evaluate the success of the call."
This enforces the rubric of the evaluation. The output is stored in call.analysis.successEvaluation.
Options include:
Default is 'PassFail'.
NumericScale, DescriptiveScale, Checklist, Matrix, PercentageScale, LikertScale, AutomaticRubric, PassFail This is how long the request is tried before giving up. When request times out, call.analysis.summary will be empty.
Usage:
1 <= x <= 6030
This is the plan for generating the structured data from the call. This outputs to call.analysis.structuredData.
Show child attributes
This determines whether structured data is generated and stored in call.analysis.structuredData. Defaults to false.
Usage:
schema.@default false
This is the prompt that the model will use to generate the structured data of the call.
"Extract structured data from the call."
This is how long the request is tried before giving up. When request times out, call.analysis.structuredData will be empty.
Usage:
@default 5 seconds
1 <= x <= 6030
This is the schema of the structured data. The output is stored in call.analysis.structuredData.
Complete guide on JSON Schema can be found here.
Show child attributes
This is the type of output you'd like.
string, number, integer, boolean are the primitive types and should be obvious.
array and object are more interesting and quite powerful. They allow you to define nested structures.
For array, you can define the schema of the items in the array using the items property.
For object, you can define the properties of the object using the properties property.
string, number, integer, boolean, array, object This is required if the type is "array". This is the schema of the items in the array.
This is of type JsonSchema. However, Swagger doesn't support circular references.
This is required if the type is "object". This specifies the properties of the object.
This is a map of string to JsonSchema. However, Swagger doesn't support circular references.
This is the description to help the model understand what it needs to output.
This is a list of properties that are required.
This only makes sense if the type is "object".
{
"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"
}
}
}This is where you can override the default behavior of the assistant.
Show child attributes
This is the message that the assistant will say when the call starts.
"Hello, how can I help you today?"
This is the mode of the welcome message. It can be one of the following: 'assistant-speaks-first', 'assistant-waits-for-user', 'automatic'.
"assistant-speaks-first"
This is a boolean that controls whether the interruptions are enabled during the welcome message. If set to false, the user can not interrupt the welcome message.
false
This is a boolean that controls whether the recording is enabled. If set to false, the model will not record the call.
@default true
true
This is the path where the recording will be stored. If not provided, the recording will be stored in the default path.
"/recordings"
This is the dynamic variables of the conversation. Values in this object will be replaced in the assistant system prompt, welcome message, end call message. If your dynamic variable is user_name, you can use it in the system prompt message as Hello, {{user_name}}.
{ "user_name": "John Doe" }This is where Interactly will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.
Show child attributes
API endpoint to send requests to.
"https://api.example.com/v1/getUserDetails"
This is the timeout in seconds for the request to your server. Defaults to 20 seconds.
@default 20
1 <= x <= 12020
This is the secret you can set that Interactly will send with every request to your server. Will be sent as a header called x-interactly-secret.
"my-secret"
These are the custom headers to include in the request sent to your server.
Each key-value pair represents a header name and its value.
{}This is a boolean that controls whether the server is enabled. If set to false, the model will not send webhooks to the server.
@default false
false
These are the messages that will be sent to your Server URL.
status-update, conversation-update, hang, end-of-call-report [
"status-update",
"conversation-update",
"hang",
"end-of-call-report"
]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
This is the message that the assistant will say when the call starts.
"Hello, how can I help you today?"
This is the mode of the welcome message. It can be one of the following: 'assistant-speaks-first', 'assistant-waits-for-user', 'automatic'.
"assistant-speaks-first"
This is a boolean that controls whether the interruptions are enabled during the welcome message. If set to false, the user can not interrupt the welcome message.
false
This is a boolean that controls whether the recording is enabled. If set to false, the model will not record the call.
@default true
true
This is the path where the recording will be stored. If not provided, the recording will be stored in the default path.
"/recordings"
This is the dynamic variables of the conversation. Values in this object will be replaced in the assistant system prompt, welcome message, end call message. If your dynamic variable is user_name, you can use it in the system prompt message as Hello, {{user_name}}.
{ "user_name": "John Doe" }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"
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
This is the phone number of the sender.
"+1234567890"
This is the phone number of the receiver.
"+1234567890"
This is the twiml response to be given to twilio.
"twiml-response-tobe-given-to-twilio"
This is the response type of the phone number.
text/xml, application/json "text/xml"
This is status callback websocket URL. Using this URL you can get the status of the call.
"https://<domain>.interactly.ai/voice/twilio/call-status/<call-id>"
This is the status callback event of the phone number.
initiated, ringing, answered, completed