Create agent
curl --request POST \
--url https://app.freyavoice.ai/api/v2/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer Support Agent",
"config": {
"llmConfig": {
"provider": "openai",
"model": "gpt-4o",
"systemPrompt": "You are a helpful customer support agent...",
"firstMessage": "Hello! How can I help you today?",
"firstMessageMode": "assistant-speaks-first",
"maxTokens": 1000,
"temperature": 0.7
},
"ttsConfig": {
"provider": "elevenlabs",
"model": "eleven_multilingual_v2",
"voiceId": "21m00Tcm4TlvDq8ikWAM",
"language": "en",
"speed": 1,
"stability": 0.5,
"similarityBoost": 0.75,
"additionalSettings": {}
},
"sttConfig": {
"provider": "deepgram",
"model": "nova-2",
"language": "en",
"temperature": null,
"punctuate": true,
"diarize": false,
"additionalSettings": {}
},
"complianceConfig": {
"pciDss": false,
"mifidIi": false,
"euAiAct": false,
"soc2": false
}
}
}
'import requests
url = "https://app.freyavoice.ai/api/v2/agents"
payload = {
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer Support Agent",
"config": {
"llmConfig": {
"provider": "openai",
"model": "gpt-4o",
"systemPrompt": "You are a helpful customer support agent...",
"firstMessage": "Hello! How can I help you today?",
"firstMessageMode": "assistant-speaks-first",
"maxTokens": 1000,
"temperature": 0.7
},
"ttsConfig": {
"provider": "elevenlabs",
"model": "eleven_multilingual_v2",
"voiceId": "21m00Tcm4TlvDq8ikWAM",
"language": "en",
"speed": 1,
"stability": 0.5,
"similarityBoost": 0.75,
"additionalSettings": {}
},
"sttConfig": {
"provider": "deepgram",
"model": "nova-2",
"language": "en",
"temperature": None,
"punctuate": True,
"diarize": False,
"additionalSettings": {}
},
"complianceConfig": {
"pciDss": False,
"mifidIi": False,
"euAiAct": False,
"soc2": False
}
}
}
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({
workspaceId: '550e8400-e29b-41d4-a716-446655440000',
name: 'Customer Support Agent',
config: {
llmConfig: {
provider: 'openai',
model: 'gpt-4o',
systemPrompt: 'You are a helpful customer support agent...',
firstMessage: 'Hello! How can I help you today?',
firstMessageMode: 'assistant-speaks-first',
maxTokens: 1000,
temperature: 0.7
},
ttsConfig: {
provider: 'elevenlabs',
model: 'eleven_multilingual_v2',
voiceId: '21m00Tcm4TlvDq8ikWAM',
language: 'en',
speed: 1,
stability: 0.5,
similarityBoost: 0.75,
additionalSettings: {}
},
sttConfig: {
provider: 'deepgram',
model: 'nova-2',
language: 'en',
temperature: null,
punctuate: true,
diarize: false,
additionalSettings: {}
},
complianceConfig: {pciDss: false, mifidIi: false, euAiAct: false, soc2: false}
}
})
};
fetch('https://app.freyavoice.ai/api/v2/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.freyavoice.ai/api/v2/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workspaceId' => '550e8400-e29b-41d4-a716-446655440000',
'name' => 'Customer Support Agent',
'config' => [
'llmConfig' => [
'provider' => 'openai',
'model' => 'gpt-4o',
'systemPrompt' => 'You are a helpful customer support agent...',
'firstMessage' => 'Hello! How can I help you today?',
'firstMessageMode' => 'assistant-speaks-first',
'maxTokens' => 1000,
'temperature' => 0.7
],
'ttsConfig' => [
'provider' => 'elevenlabs',
'model' => 'eleven_multilingual_v2',
'voiceId' => '21m00Tcm4TlvDq8ikWAM',
'language' => 'en',
'speed' => 1,
'stability' => 0.5,
'similarityBoost' => 0.75,
'additionalSettings' => [
]
],
'sttConfig' => [
'provider' => 'deepgram',
'model' => 'nova-2',
'language' => 'en',
'temperature' => null,
'punctuate' => true,
'diarize' => false,
'additionalSettings' => [
]
],
'complianceConfig' => [
'pciDss' => false,
'mifidIi' => false,
'euAiAct' => false,
'soc2' => false
]
]
]),
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://app.freyavoice.ai/api/v2/agents"
payload := strings.NewReader("{\n \"workspaceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"name\": \"Customer Support Agent\",\n \"config\": {\n \"llmConfig\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4o\",\n \"systemPrompt\": \"You are a helpful customer support agent...\",\n \"firstMessage\": \"Hello! How can I help you today?\",\n \"firstMessageMode\": \"assistant-speaks-first\",\n \"maxTokens\": 1000,\n \"temperature\": 0.7\n },\n \"ttsConfig\": {\n \"provider\": \"elevenlabs\",\n \"model\": \"eleven_multilingual_v2\",\n \"voiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n \"language\": \"en\",\n \"speed\": 1,\n \"stability\": 0.5,\n \"similarityBoost\": 0.75,\n \"additionalSettings\": {}\n },\n \"sttConfig\": {\n \"provider\": \"deepgram\",\n \"model\": \"nova-2\",\n \"language\": \"en\",\n \"temperature\": null,\n \"punctuate\": true,\n \"diarize\": false,\n \"additionalSettings\": {}\n },\n \"complianceConfig\": {\n \"pciDss\": false,\n \"mifidIi\": false,\n \"euAiAct\": false,\n \"soc2\": false\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://app.freyavoice.ai/api/v2/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"name\": \"Customer Support Agent\",\n \"config\": {\n \"llmConfig\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4o\",\n \"systemPrompt\": \"You are a helpful customer support agent...\",\n \"firstMessage\": \"Hello! How can I help you today?\",\n \"firstMessageMode\": \"assistant-speaks-first\",\n \"maxTokens\": 1000,\n \"temperature\": 0.7\n },\n \"ttsConfig\": {\n \"provider\": \"elevenlabs\",\n \"model\": \"eleven_multilingual_v2\",\n \"voiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n \"language\": \"en\",\n \"speed\": 1,\n \"stability\": 0.5,\n \"similarityBoost\": 0.75,\n \"additionalSettings\": {}\n },\n \"sttConfig\": {\n \"provider\": \"deepgram\",\n \"model\": \"nova-2\",\n \"language\": \"en\",\n \"temperature\": null,\n \"punctuate\": true,\n \"diarize\": false,\n \"additionalSettings\": {}\n },\n \"complianceConfig\": {\n \"pciDss\": false,\n \"mifidIi\": false,\n \"euAiAct\": false,\n \"soc2\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/agents")
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 \"workspaceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"name\": \"Customer Support Agent\",\n \"config\": {\n \"llmConfig\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4o\",\n \"systemPrompt\": \"You are a helpful customer support agent...\",\n \"firstMessage\": \"Hello! How can I help you today?\",\n \"firstMessageMode\": \"assistant-speaks-first\",\n \"maxTokens\": 1000,\n \"temperature\": 0.7\n },\n \"ttsConfig\": {\n \"provider\": \"elevenlabs\",\n \"model\": \"eleven_multilingual_v2\",\n \"voiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n \"language\": \"en\",\n \"speed\": 1,\n \"stability\": 0.5,\n \"similarityBoost\": 0.75,\n \"additionalSettings\": {}\n },\n \"sttConfig\": {\n \"provider\": \"deepgram\",\n \"model\": \"nova-2\",\n \"language\": \"en\",\n \"temperature\": null,\n \"punctuate\": true,\n \"diarize\": false,\n \"additionalSettings\": {}\n },\n \"complianceConfig\": {\n \"pciDss\": false,\n \"mifidIi\": false,\n \"euAiAct\": false,\n \"soc2\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"config": {
"llmConfig": {
"provider": "<string>",
"model": "<string>",
"systemPrompt": "<string>",
"baseUrl": "<string>",
"apiKey": "<string>",
"firstMessage": null,
"firstMessageMode": "assistant-waits-for-user",
"disableInterruptionsDuringFirstMessage": false,
"maxTokens": 1000,
"maxContextWindow": 5000512,
"temperature": 0.7,
"tools": [],
"additionalSettings": {},
"retryExhaustionMessage": "<string>",
"farewellMessage": "<string>"
},
"ttsConfig": {
"provider": "<string>",
"voiceId": "<string>",
"model": null,
"language": "multi",
"baseUrl": "<string>",
"apiKey": "<string>",
"additionalSettings": {},
"startSpeakingPlan": {
"waitSeconds": 0.4,
"backgroundNoisePhrases": [
"<string>"
]
},
"stopSpeakingPlan": {
"numberOfWords": 1,
"voiceSeconds": 0.4,
"backOffSeconds": 0.4,
"acknowledgementPhrases": [
"<string>"
],
"interruptionPhrases": [
"<string>"
]
},
"textSubstitutions": [
{
"pattern": "<string>",
"replacement": "<string>",
"caseInsensitive": true
}
],
"speechNormalization": {
"emails": true,
"urls": true,
"emojis": true,
"phoneNumbers": false,
"identityNumbers": false,
"generalNumbers": false,
"advanced": {
"numbers": false,
"money": false,
"dates": false,
"times": false,
"percentages": false,
"fractions": false,
"units": false,
"ordinals": false,
"abbreviations": false,
"iban": false,
"symbols": false
}
},
"normalizationPrompt": "<string>"
},
"sttConfig": {
"provider": "<string>",
"model": null,
"language": "multi",
"baseUrl": "<string>",
"apiKey": "<string>",
"additionalSettings": {},
"confidenceReask": {
"enabled": false,
"threshold": 0.3,
"reduction": "min",
"disableOnDigitNodes": true,
"reaskMode": "phrase",
"reaskPhrases": null,
"maxConsecutiveReasks": 2
}
},
"complianceConfig": {
"pciDss": false,
"mifidIi": false,
"euAiAct": false,
"soc2": false
},
"callTimeoutSettings": {
"silenceTimeout": 0,
"maximumDuration": 600,
"checkInMessage": null,
"closureMessage": null,
"maxRetries": 2,
"silenceTimeoutPrompt": null,
"maxDurationEndCall": null,
"dynamicWait": null
},
"voicemailDetection": {
"enabled": false,
"messageMode": "none",
"staticMessage": null,
"voicemailResponseDelay": 2
},
"dtmfConfig": {
"enabled": false,
"timeout": 2,
"terminationDigit": "#",
"prefix": "DTMF: "
},
"postConversationAnalysis": {
"summaryPrompt": null,
"autoDetectProblems": false,
"problemDetectionPrompt": null,
"problemDetectionInstructions": null,
"analysisModel": null
},
"privacyConfig": {
"enableRecording": false,
"getRecordingConsent": false,
"recordingConsentText": null,
"stopSecs": 1,
"preSpeechMs": 1,
"maxDurationSecs": 1
},
"turnAnalyzerConfig": {
"provider": "local",
"url": "<string>",
"modelPath": "<string>"
},
"guardrailsConfig": {
"guardrails_enabled": false,
"custom_rules_enabled": false,
"rules": [],
"refuse_message": "I'm sorry, I can't help with that.",
"max_regenerate_retries": 2,
"regenerate_wait_message": "One moment, please.",
"classifier_enabled": false,
"classifier_provider": "<string>",
"classifier_model": "<string>",
"input_config": {
"enabled": false,
"normalize": true,
"detect_injection": true,
"detect_weird_input": true,
"run_classifier": true,
"refuse_message": "I'm sorry, I can't help with that.",
"max_input_chars": 8000
}
},
"piiRedactionConfig": {
"enabled": false,
"maskEmail": true,
"maskPhone": true,
"maskPaymentCard": true,
"maskNationalId": true,
"maskIban": true,
"customRules": []
},
"routingLlmConfig": {
"provider": "<string>",
"model": "<string>",
"baseUrl": "<string>",
"apiKey": "<string>"
},
"extractionLlmConfig": {
"provider": "<string>",
"model": "<string>",
"baseUrl": "<string>",
"apiKey": "<string>"
},
"backgroundSoundUrl": null,
"syncSource": {
"url": "<string>",
"apiKey": "<string>",
"syncedAt": "2023-11-07T05:31:56Z"
},
"testVariables": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"entityType": "workflow",
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isImported": false
}
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}Agents
Create agent
Creates a new AI agent with the specified configuration.
POST
/
agents
Create agent
curl --request POST \
--url https://app.freyavoice.ai/api/v2/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer Support Agent",
"config": {
"llmConfig": {
"provider": "openai",
"model": "gpt-4o",
"systemPrompt": "You are a helpful customer support agent...",
"firstMessage": "Hello! How can I help you today?",
"firstMessageMode": "assistant-speaks-first",
"maxTokens": 1000,
"temperature": 0.7
},
"ttsConfig": {
"provider": "elevenlabs",
"model": "eleven_multilingual_v2",
"voiceId": "21m00Tcm4TlvDq8ikWAM",
"language": "en",
"speed": 1,
"stability": 0.5,
"similarityBoost": 0.75,
"additionalSettings": {}
},
"sttConfig": {
"provider": "deepgram",
"model": "nova-2",
"language": "en",
"temperature": null,
"punctuate": true,
"diarize": false,
"additionalSettings": {}
},
"complianceConfig": {
"pciDss": false,
"mifidIi": false,
"euAiAct": false,
"soc2": false
}
}
}
'import requests
url = "https://app.freyavoice.ai/api/v2/agents"
payload = {
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer Support Agent",
"config": {
"llmConfig": {
"provider": "openai",
"model": "gpt-4o",
"systemPrompt": "You are a helpful customer support agent...",
"firstMessage": "Hello! How can I help you today?",
"firstMessageMode": "assistant-speaks-first",
"maxTokens": 1000,
"temperature": 0.7
},
"ttsConfig": {
"provider": "elevenlabs",
"model": "eleven_multilingual_v2",
"voiceId": "21m00Tcm4TlvDq8ikWAM",
"language": "en",
"speed": 1,
"stability": 0.5,
"similarityBoost": 0.75,
"additionalSettings": {}
},
"sttConfig": {
"provider": "deepgram",
"model": "nova-2",
"language": "en",
"temperature": None,
"punctuate": True,
"diarize": False,
"additionalSettings": {}
},
"complianceConfig": {
"pciDss": False,
"mifidIi": False,
"euAiAct": False,
"soc2": False
}
}
}
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({
workspaceId: '550e8400-e29b-41d4-a716-446655440000',
name: 'Customer Support Agent',
config: {
llmConfig: {
provider: 'openai',
model: 'gpt-4o',
systemPrompt: 'You are a helpful customer support agent...',
firstMessage: 'Hello! How can I help you today?',
firstMessageMode: 'assistant-speaks-first',
maxTokens: 1000,
temperature: 0.7
},
ttsConfig: {
provider: 'elevenlabs',
model: 'eleven_multilingual_v2',
voiceId: '21m00Tcm4TlvDq8ikWAM',
language: 'en',
speed: 1,
stability: 0.5,
similarityBoost: 0.75,
additionalSettings: {}
},
sttConfig: {
provider: 'deepgram',
model: 'nova-2',
language: 'en',
temperature: null,
punctuate: true,
diarize: false,
additionalSettings: {}
},
complianceConfig: {pciDss: false, mifidIi: false, euAiAct: false, soc2: false}
}
})
};
fetch('https://app.freyavoice.ai/api/v2/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.freyavoice.ai/api/v2/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workspaceId' => '550e8400-e29b-41d4-a716-446655440000',
'name' => 'Customer Support Agent',
'config' => [
'llmConfig' => [
'provider' => 'openai',
'model' => 'gpt-4o',
'systemPrompt' => 'You are a helpful customer support agent...',
'firstMessage' => 'Hello! How can I help you today?',
'firstMessageMode' => 'assistant-speaks-first',
'maxTokens' => 1000,
'temperature' => 0.7
],
'ttsConfig' => [
'provider' => 'elevenlabs',
'model' => 'eleven_multilingual_v2',
'voiceId' => '21m00Tcm4TlvDq8ikWAM',
'language' => 'en',
'speed' => 1,
'stability' => 0.5,
'similarityBoost' => 0.75,
'additionalSettings' => [
]
],
'sttConfig' => [
'provider' => 'deepgram',
'model' => 'nova-2',
'language' => 'en',
'temperature' => null,
'punctuate' => true,
'diarize' => false,
'additionalSettings' => [
]
],
'complianceConfig' => [
'pciDss' => false,
'mifidIi' => false,
'euAiAct' => false,
'soc2' => false
]
]
]),
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://app.freyavoice.ai/api/v2/agents"
payload := strings.NewReader("{\n \"workspaceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"name\": \"Customer Support Agent\",\n \"config\": {\n \"llmConfig\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4o\",\n \"systemPrompt\": \"You are a helpful customer support agent...\",\n \"firstMessage\": \"Hello! How can I help you today?\",\n \"firstMessageMode\": \"assistant-speaks-first\",\n \"maxTokens\": 1000,\n \"temperature\": 0.7\n },\n \"ttsConfig\": {\n \"provider\": \"elevenlabs\",\n \"model\": \"eleven_multilingual_v2\",\n \"voiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n \"language\": \"en\",\n \"speed\": 1,\n \"stability\": 0.5,\n \"similarityBoost\": 0.75,\n \"additionalSettings\": {}\n },\n \"sttConfig\": {\n \"provider\": \"deepgram\",\n \"model\": \"nova-2\",\n \"language\": \"en\",\n \"temperature\": null,\n \"punctuate\": true,\n \"diarize\": false,\n \"additionalSettings\": {}\n },\n \"complianceConfig\": {\n \"pciDss\": false,\n \"mifidIi\": false,\n \"euAiAct\": false,\n \"soc2\": false\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://app.freyavoice.ai/api/v2/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"name\": \"Customer Support Agent\",\n \"config\": {\n \"llmConfig\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4o\",\n \"systemPrompt\": \"You are a helpful customer support agent...\",\n \"firstMessage\": \"Hello! How can I help you today?\",\n \"firstMessageMode\": \"assistant-speaks-first\",\n \"maxTokens\": 1000,\n \"temperature\": 0.7\n },\n \"ttsConfig\": {\n \"provider\": \"elevenlabs\",\n \"model\": \"eleven_multilingual_v2\",\n \"voiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n \"language\": \"en\",\n \"speed\": 1,\n \"stability\": 0.5,\n \"similarityBoost\": 0.75,\n \"additionalSettings\": {}\n },\n \"sttConfig\": {\n \"provider\": \"deepgram\",\n \"model\": \"nova-2\",\n \"language\": \"en\",\n \"temperature\": null,\n \"punctuate\": true,\n \"diarize\": false,\n \"additionalSettings\": {}\n },\n \"complianceConfig\": {\n \"pciDss\": false,\n \"mifidIi\": false,\n \"euAiAct\": false,\n \"soc2\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/agents")
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 \"workspaceId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"name\": \"Customer Support Agent\",\n \"config\": {\n \"llmConfig\": {\n \"provider\": \"openai\",\n \"model\": \"gpt-4o\",\n \"systemPrompt\": \"You are a helpful customer support agent...\",\n \"firstMessage\": \"Hello! How can I help you today?\",\n \"firstMessageMode\": \"assistant-speaks-first\",\n \"maxTokens\": 1000,\n \"temperature\": 0.7\n },\n \"ttsConfig\": {\n \"provider\": \"elevenlabs\",\n \"model\": \"eleven_multilingual_v2\",\n \"voiceId\": \"21m00Tcm4TlvDq8ikWAM\",\n \"language\": \"en\",\n \"speed\": 1,\n \"stability\": 0.5,\n \"similarityBoost\": 0.75,\n \"additionalSettings\": {}\n },\n \"sttConfig\": {\n \"provider\": \"deepgram\",\n \"model\": \"nova-2\",\n \"language\": \"en\",\n \"temperature\": null,\n \"punctuate\": true,\n \"diarize\": false,\n \"additionalSettings\": {}\n },\n \"complianceConfig\": {\n \"pciDss\": false,\n \"mifidIi\": false,\n \"euAiAct\": false,\n \"soc2\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"config": {
"llmConfig": {
"provider": "<string>",
"model": "<string>",
"systemPrompt": "<string>",
"baseUrl": "<string>",
"apiKey": "<string>",
"firstMessage": null,
"firstMessageMode": "assistant-waits-for-user",
"disableInterruptionsDuringFirstMessage": false,
"maxTokens": 1000,
"maxContextWindow": 5000512,
"temperature": 0.7,
"tools": [],
"additionalSettings": {},
"retryExhaustionMessage": "<string>",
"farewellMessage": "<string>"
},
"ttsConfig": {
"provider": "<string>",
"voiceId": "<string>",
"model": null,
"language": "multi",
"baseUrl": "<string>",
"apiKey": "<string>",
"additionalSettings": {},
"startSpeakingPlan": {
"waitSeconds": 0.4,
"backgroundNoisePhrases": [
"<string>"
]
},
"stopSpeakingPlan": {
"numberOfWords": 1,
"voiceSeconds": 0.4,
"backOffSeconds": 0.4,
"acknowledgementPhrases": [
"<string>"
],
"interruptionPhrases": [
"<string>"
]
},
"textSubstitutions": [
{
"pattern": "<string>",
"replacement": "<string>",
"caseInsensitive": true
}
],
"speechNormalization": {
"emails": true,
"urls": true,
"emojis": true,
"phoneNumbers": false,
"identityNumbers": false,
"generalNumbers": false,
"advanced": {
"numbers": false,
"money": false,
"dates": false,
"times": false,
"percentages": false,
"fractions": false,
"units": false,
"ordinals": false,
"abbreviations": false,
"iban": false,
"symbols": false
}
},
"normalizationPrompt": "<string>"
},
"sttConfig": {
"provider": "<string>",
"model": null,
"language": "multi",
"baseUrl": "<string>",
"apiKey": "<string>",
"additionalSettings": {},
"confidenceReask": {
"enabled": false,
"threshold": 0.3,
"reduction": "min",
"disableOnDigitNodes": true,
"reaskMode": "phrase",
"reaskPhrases": null,
"maxConsecutiveReasks": 2
}
},
"complianceConfig": {
"pciDss": false,
"mifidIi": false,
"euAiAct": false,
"soc2": false
},
"callTimeoutSettings": {
"silenceTimeout": 0,
"maximumDuration": 600,
"checkInMessage": null,
"closureMessage": null,
"maxRetries": 2,
"silenceTimeoutPrompt": null,
"maxDurationEndCall": null,
"dynamicWait": null
},
"voicemailDetection": {
"enabled": false,
"messageMode": "none",
"staticMessage": null,
"voicemailResponseDelay": 2
},
"dtmfConfig": {
"enabled": false,
"timeout": 2,
"terminationDigit": "#",
"prefix": "DTMF: "
},
"postConversationAnalysis": {
"summaryPrompt": null,
"autoDetectProblems": false,
"problemDetectionPrompt": null,
"problemDetectionInstructions": null,
"analysisModel": null
},
"privacyConfig": {
"enableRecording": false,
"getRecordingConsent": false,
"recordingConsentText": null,
"stopSecs": 1,
"preSpeechMs": 1,
"maxDurationSecs": 1
},
"turnAnalyzerConfig": {
"provider": "local",
"url": "<string>",
"modelPath": "<string>"
},
"guardrailsConfig": {
"guardrails_enabled": false,
"custom_rules_enabled": false,
"rules": [],
"refuse_message": "I'm sorry, I can't help with that.",
"max_regenerate_retries": 2,
"regenerate_wait_message": "One moment, please.",
"classifier_enabled": false,
"classifier_provider": "<string>",
"classifier_model": "<string>",
"input_config": {
"enabled": false,
"normalize": true,
"detect_injection": true,
"detect_weird_input": true,
"run_classifier": true,
"refuse_message": "I'm sorry, I can't help with that.",
"max_input_chars": 8000
}
},
"piiRedactionConfig": {
"enabled": false,
"maskEmail": true,
"maskPhone": true,
"maskPaymentCard": true,
"maskNationalId": true,
"maskIban": true,
"customRules": []
},
"routingLlmConfig": {
"provider": "<string>",
"model": "<string>",
"baseUrl": "<string>",
"apiKey": "<string>"
},
"extractionLlmConfig": {
"provider": "<string>",
"model": "<string>",
"baseUrl": "<string>",
"apiKey": "<string>"
},
"backgroundSoundUrl": null,
"syncSource": {
"url": "<string>",
"apiKey": "<string>",
"syncedAt": "2023-11-07T05:31:56Z"
},
"testVariables": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"entityType": "workflow",
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isImported": false
}
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json