curl --request PATCH \
--url https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"agentName": "<string>",
"greetingMessage": "<string>",
"greetingMessageType": "<string>",
"preamble": "<string>",
"pokeMessages": [
"<string>"
],
"realTime": true,
"silenceThreshold": 123,
"interrupt": true,
"outcome": "<string>",
"outcomeResponseShape": {
"type": "object",
"properties": {
"test": {
"type": "number",
"description": "Hello world from Hamsa AI!"
}
},
"required": [
"test"
]
},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
},
"voiceId": "<string>",
"description": "<string>",
"isTemplate": true,
"icon": "<string>",
"tools": {
"genderDetection": false,
"smartCallEnd": false
},
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
},
"knowledgeBaseItemsIds": [
"<string>"
],
"webToolsIds": [
"<string>"
],
"voiceDictionaryIds": [
"<string>"
],
"userInactivityTimeout": 17.5,
"maxCallDuration": 315,
"responseDelay": 800,
"backgroundNoise": true,
"waitForUserToSpeakFirst": 1,
"thinkingVoice": true,
"speakerIdentification": true,
"llmConfig": {
"provider": "OpenAI",
"modelName": "GPT-4.1",
"baseUrl": "https://api.custom-llm.com/v1",
"apiKey": "sk-...",
"temperature": 0.2
},
"webToolsOverrides": {},
"agenticRag": true,
"languageDialectSwitcher": true,
"noiseCancellation": "<string>",
"cancelNoisePer": "<string>",
"minInterruptionDuration": 0.85,
"vadActivationThreshold": 0.55,
"enableAutoGainControl": true,
"sendDenoisedToStt": true
}
'import requests
url = "https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}"
payload = {
"agentName": "<string>",
"greetingMessage": "<string>",
"greetingMessageType": "<string>",
"preamble": "<string>",
"pokeMessages": ["<string>"],
"realTime": True,
"silenceThreshold": 123,
"interrupt": True,
"outcome": "<string>",
"outcomeResponseShape": {
"type": "object",
"properties": { "test": {
"type": "number",
"description": "Hello world from Hamsa AI!"
} },
"required": ["test"]
},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
},
"voiceId": "<string>",
"description": "<string>",
"isTemplate": True,
"icon": "<string>",
"tools": {
"genderDetection": False,
"smartCallEnd": False
},
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
},
"knowledgeBaseItemsIds": ["<string>"],
"webToolsIds": ["<string>"],
"voiceDictionaryIds": ["<string>"],
"userInactivityTimeout": 17.5,
"maxCallDuration": 315,
"responseDelay": 800,
"backgroundNoise": True,
"waitForUserToSpeakFirst": 1,
"thinkingVoice": True,
"speakerIdentification": True,
"llmConfig": {
"provider": "OpenAI",
"modelName": "GPT-4.1",
"baseUrl": "https://api.custom-llm.com/v1",
"apiKey": "sk-...",
"temperature": 0.2
},
"webToolsOverrides": {},
"agenticRag": True,
"languageDialectSwitcher": True,
"noiseCancellation": "<string>",
"cancelNoisePer": "<string>",
"minInterruptionDuration": 0.85,
"vadActivationThreshold": 0.55,
"enableAutoGainControl": True,
"sendDenoisedToStt": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentName: '<string>',
greetingMessage: '<string>',
greetingMessageType: '<string>',
preamble: '<string>',
pokeMessages: ['<string>'],
realTime: true,
silenceThreshold: 123,
interrupt: true,
outcome: '<string>',
outcomeResponseShape: {
type: 'object',
properties: {test: {type: 'number', description: 'Hello world from Hamsa AI!'}},
required: ['test']
},
webhookUrl: 'https://example.com/webhook',
webhookAuth: {authKey: 'Token', authSecret: 'Secret'},
voiceId: '<string>',
description: '<string>',
isTemplate: true,
icon: '<string>',
tools: {genderDetection: false, smartCallEnd: false},
params: {},
alignment: {greetingMessage: 'ltr', preamble: 'ltr'},
knowledgeBaseItemsIds: ['<string>'],
webToolsIds: ['<string>'],
voiceDictionaryIds: ['<string>'],
userInactivityTimeout: 17.5,
maxCallDuration: 315,
responseDelay: 800,
backgroundNoise: true,
waitForUserToSpeakFirst: 1,
thinkingVoice: true,
speakerIdentification: true,
llmConfig: {
provider: 'OpenAI',
modelName: 'GPT-4.1',
baseUrl: 'https://api.custom-llm.com/v1',
apiKey: 'sk-...',
temperature: 0.2
},
webToolsOverrides: {},
agenticRag: true,
languageDialectSwitcher: true,
noiseCancellation: '<string>',
cancelNoisePer: '<string>',
minInterruptionDuration: 0.85,
vadActivationThreshold: 0.55,
enableAutoGainControl: true,
sendDenoisedToStt: true
})
};
fetch('https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}', 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.tryhamsa.com/v1/voice-agents/{voiceAgentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agentName' => '<string>',
'greetingMessage' => '<string>',
'greetingMessageType' => '<string>',
'preamble' => '<string>',
'pokeMessages' => [
'<string>'
],
'realTime' => true,
'silenceThreshold' => 123,
'interrupt' => true,
'outcome' => '<string>',
'outcomeResponseShape' => [
'type' => 'object',
'properties' => [
'test' => [
'type' => 'number',
'description' => 'Hello world from Hamsa AI!'
]
],
'required' => [
'test'
]
],
'webhookUrl' => 'https://example.com/webhook',
'webhookAuth' => [
'authKey' => 'Token',
'authSecret' => 'Secret'
],
'voiceId' => '<string>',
'description' => '<string>',
'isTemplate' => true,
'icon' => '<string>',
'tools' => [
'genderDetection' => false,
'smartCallEnd' => false
],
'params' => [
],
'alignment' => [
'greetingMessage' => 'ltr',
'preamble' => 'ltr'
],
'knowledgeBaseItemsIds' => [
'<string>'
],
'webToolsIds' => [
'<string>'
],
'voiceDictionaryIds' => [
'<string>'
],
'userInactivityTimeout' => 17.5,
'maxCallDuration' => 315,
'responseDelay' => 800,
'backgroundNoise' => true,
'waitForUserToSpeakFirst' => 1,
'thinkingVoice' => true,
'speakerIdentification' => true,
'llmConfig' => [
'provider' => 'OpenAI',
'modelName' => 'GPT-4.1',
'baseUrl' => 'https://api.custom-llm.com/v1',
'apiKey' => 'sk-...',
'temperature' => 0.2
],
'webToolsOverrides' => [
],
'agenticRag' => true,
'languageDialectSwitcher' => true,
'noiseCancellation' => '<string>',
'cancelNoisePer' => '<string>',
'minInterruptionDuration' => 0.85,
'vadActivationThreshold' => 0.55,
'enableAutoGainControl' => true,
'sendDenoisedToStt' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.tryhamsa.com/v1/voice-agents/{voiceAgentId}"
payload := strings.NewReader("{\n \"agentName\": \"<string>\",\n \"greetingMessage\": \"<string>\",\n \"greetingMessageType\": \"<string>\",\n \"preamble\": \"<string>\",\n \"pokeMessages\": [\n \"<string>\"\n ],\n \"realTime\": true,\n \"silenceThreshold\": 123,\n \"interrupt\": true,\n \"outcome\": \"<string>\",\n \"outcomeResponseShape\": {\n \"type\": \"object\",\n \"properties\": {\n \"test\": {\n \"type\": \"number\",\n \"description\": \"Hello world from Hamsa AI!\"\n }\n },\n \"required\": [\n \"test\"\n ]\n },\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"authKey\": \"Token\",\n \"authSecret\": \"Secret\"\n },\n \"voiceId\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"icon\": \"<string>\",\n \"tools\": {\n \"genderDetection\": false,\n \"smartCallEnd\": false\n },\n \"params\": {},\n \"alignment\": {\n \"greetingMessage\": \"ltr\",\n \"preamble\": \"ltr\"\n },\n \"knowledgeBaseItemsIds\": [\n \"<string>\"\n ],\n \"webToolsIds\": [\n \"<string>\"\n ],\n \"voiceDictionaryIds\": [\n \"<string>\"\n ],\n \"userInactivityTimeout\": 17.5,\n \"maxCallDuration\": 315,\n \"responseDelay\": 800,\n \"backgroundNoise\": true,\n \"waitForUserToSpeakFirst\": 1,\n \"thinkingVoice\": true,\n \"speakerIdentification\": true,\n \"llmConfig\": {\n \"provider\": \"OpenAI\",\n \"modelName\": \"GPT-4.1\",\n \"baseUrl\": \"https://api.custom-llm.com/v1\",\n \"apiKey\": \"sk-...\",\n \"temperature\": 0.2\n },\n \"webToolsOverrides\": {},\n \"agenticRag\": true,\n \"languageDialectSwitcher\": true,\n \"noiseCancellation\": \"<string>\",\n \"cancelNoisePer\": \"<string>\",\n \"minInterruptionDuration\": 0.85,\n \"vadActivationThreshold\": 0.55,\n \"enableAutoGainControl\": true,\n \"sendDenoisedToStt\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentName\": \"<string>\",\n \"greetingMessage\": \"<string>\",\n \"greetingMessageType\": \"<string>\",\n \"preamble\": \"<string>\",\n \"pokeMessages\": [\n \"<string>\"\n ],\n \"realTime\": true,\n \"silenceThreshold\": 123,\n \"interrupt\": true,\n \"outcome\": \"<string>\",\n \"outcomeResponseShape\": {\n \"type\": \"object\",\n \"properties\": {\n \"test\": {\n \"type\": \"number\",\n \"description\": \"Hello world from Hamsa AI!\"\n }\n },\n \"required\": [\n \"test\"\n ]\n },\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"authKey\": \"Token\",\n \"authSecret\": \"Secret\"\n },\n \"voiceId\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"icon\": \"<string>\",\n \"tools\": {\n \"genderDetection\": false,\n \"smartCallEnd\": false\n },\n \"params\": {},\n \"alignment\": {\n \"greetingMessage\": \"ltr\",\n \"preamble\": \"ltr\"\n },\n \"knowledgeBaseItemsIds\": [\n \"<string>\"\n ],\n \"webToolsIds\": [\n \"<string>\"\n ],\n \"voiceDictionaryIds\": [\n \"<string>\"\n ],\n \"userInactivityTimeout\": 17.5,\n \"maxCallDuration\": 315,\n \"responseDelay\": 800,\n \"backgroundNoise\": true,\n \"waitForUserToSpeakFirst\": 1,\n \"thinkingVoice\": true,\n \"speakerIdentification\": true,\n \"llmConfig\": {\n \"provider\": \"OpenAI\",\n \"modelName\": \"GPT-4.1\",\n \"baseUrl\": \"https://api.custom-llm.com/v1\",\n \"apiKey\": \"sk-...\",\n \"temperature\": 0.2\n },\n \"webToolsOverrides\": {},\n \"agenticRag\": true,\n \"languageDialectSwitcher\": true,\n \"noiseCancellation\": \"<string>\",\n \"cancelNoisePer\": \"<string>\",\n \"minInterruptionDuration\": 0.85,\n \"vadActivationThreshold\": 0.55,\n \"enableAutoGainControl\": true,\n \"sendDenoisedToStt\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentName\": \"<string>\",\n \"greetingMessage\": \"<string>\",\n \"greetingMessageType\": \"<string>\",\n \"preamble\": \"<string>\",\n \"pokeMessages\": [\n \"<string>\"\n ],\n \"realTime\": true,\n \"silenceThreshold\": 123,\n \"interrupt\": true,\n \"outcome\": \"<string>\",\n \"outcomeResponseShape\": {\n \"type\": \"object\",\n \"properties\": {\n \"test\": {\n \"type\": \"number\",\n \"description\": \"Hello world from Hamsa AI!\"\n }\n },\n \"required\": [\n \"test\"\n ]\n },\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"authKey\": \"Token\",\n \"authSecret\": \"Secret\"\n },\n \"voiceId\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"icon\": \"<string>\",\n \"tools\": {\n \"genderDetection\": false,\n \"smartCallEnd\": false\n },\n \"params\": {},\n \"alignment\": {\n \"greetingMessage\": \"ltr\",\n \"preamble\": \"ltr\"\n },\n \"knowledgeBaseItemsIds\": [\n \"<string>\"\n ],\n \"webToolsIds\": [\n \"<string>\"\n ],\n \"voiceDictionaryIds\": [\n \"<string>\"\n ],\n \"userInactivityTimeout\": 17.5,\n \"maxCallDuration\": 315,\n \"responseDelay\": 800,\n \"backgroundNoise\": true,\n \"waitForUserToSpeakFirst\": 1,\n \"thinkingVoice\": true,\n \"speakerIdentification\": true,\n \"llmConfig\": {\n \"provider\": \"OpenAI\",\n \"modelName\": \"GPT-4.1\",\n \"baseUrl\": \"https://api.custom-llm.com/v1\",\n \"apiKey\": \"sk-...\",\n \"temperature\": 0.2\n },\n \"webToolsOverrides\": {},\n \"agenticRag\": true,\n \"languageDialectSwitcher\": true,\n \"noiseCancellation\": \"<string>\",\n \"cancelNoisePer\": \"<string>\",\n \"minInterruptionDuration\": 0.85,\n \"vadActivationThreshold\": 0.55,\n \"enableAutoGainControl\": true,\n \"sendDenoisedToStt\": true\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"message": "success",
"data": {
"id": "<string>",
"agentName": "<string>",
"greetingMessage": "<string>",
"description": "<string>",
"preamble": "<string>",
"lang": "<string>",
"pokeMessages": [
"<string>"
],
"realTime": true,
"silenceThreshold": 123,
"interrupt": true,
"type": "<string>",
"outcome": "<string>",
"outcomeResponseShape": {
"type": "object",
"properties": {
"test": {
"type": "number",
"description": "Hello world from Hamsa AI!"
}
},
"required": [
"test"
]
},
"projectId": "<string>",
"apiKeyId": "<string>",
"voiceId": "<string>",
"voiceRecordId": "<string>",
"voiceRecord": {},
"collectionId": "<string>",
"isTemplate": true,
"icon": "<string>",
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
},
"params": {},
"alignment": {
"greetingMessage": "<string>",
"preamble": "<string>"
},
"tools": {
"genderDetection": true,
"smartCallEnd": true
},
"webToolsIds": [
"<string>"
],
"voiceDictionaryIds": [
"<string>"
],
"knowledgeBaseItemsIds": [
"<string>"
],
"webToolsOverrides": {},
"userInactivityTimeout": 123,
"maxCallDuration": 123,
"responseDelay": 123,
"backgroundNoise": true,
"waitForUserToSpeakFirst": 123,
"thinkingVoice": true,
"speakerIdentification": true,
"llmConfig": {
"provider": "OpenAI",
"modelName": "GPT-4.1",
"baseUrl": "https://api.custom-llm.com/v1",
"apiKey": "sk-...",
"temperature": 0.2
},
"noiseCancellation": "<string>",
"cancelNoisePer": "<string>",
"agenticRag": true,
"languageDialectSwitcher": true,
"minInterruptionDuration": 123,
"vadActivationThreshold": 123,
"enableAutoGainControl": true,
"sendDenoisedToStt": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Update Voice Agent Route
curl --request PATCH \
--url https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"agentName": "<string>",
"greetingMessage": "<string>",
"greetingMessageType": "<string>",
"preamble": "<string>",
"pokeMessages": [
"<string>"
],
"realTime": true,
"silenceThreshold": 123,
"interrupt": true,
"outcome": "<string>",
"outcomeResponseShape": {
"type": "object",
"properties": {
"test": {
"type": "number",
"description": "Hello world from Hamsa AI!"
}
},
"required": [
"test"
]
},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
},
"voiceId": "<string>",
"description": "<string>",
"isTemplate": true,
"icon": "<string>",
"tools": {
"genderDetection": false,
"smartCallEnd": false
},
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
},
"knowledgeBaseItemsIds": [
"<string>"
],
"webToolsIds": [
"<string>"
],
"voiceDictionaryIds": [
"<string>"
],
"userInactivityTimeout": 17.5,
"maxCallDuration": 315,
"responseDelay": 800,
"backgroundNoise": true,
"waitForUserToSpeakFirst": 1,
"thinkingVoice": true,
"speakerIdentification": true,
"llmConfig": {
"provider": "OpenAI",
"modelName": "GPT-4.1",
"baseUrl": "https://api.custom-llm.com/v1",
"apiKey": "sk-...",
"temperature": 0.2
},
"webToolsOverrides": {},
"agenticRag": true,
"languageDialectSwitcher": true,
"noiseCancellation": "<string>",
"cancelNoisePer": "<string>",
"minInterruptionDuration": 0.85,
"vadActivationThreshold": 0.55,
"enableAutoGainControl": true,
"sendDenoisedToStt": true
}
'import requests
url = "https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}"
payload = {
"agentName": "<string>",
"greetingMessage": "<string>",
"greetingMessageType": "<string>",
"preamble": "<string>",
"pokeMessages": ["<string>"],
"realTime": True,
"silenceThreshold": 123,
"interrupt": True,
"outcome": "<string>",
"outcomeResponseShape": {
"type": "object",
"properties": { "test": {
"type": "number",
"description": "Hello world from Hamsa AI!"
} },
"required": ["test"]
},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
},
"voiceId": "<string>",
"description": "<string>",
"isTemplate": True,
"icon": "<string>",
"tools": {
"genderDetection": False,
"smartCallEnd": False
},
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
},
"knowledgeBaseItemsIds": ["<string>"],
"webToolsIds": ["<string>"],
"voiceDictionaryIds": ["<string>"],
"userInactivityTimeout": 17.5,
"maxCallDuration": 315,
"responseDelay": 800,
"backgroundNoise": True,
"waitForUserToSpeakFirst": 1,
"thinkingVoice": True,
"speakerIdentification": True,
"llmConfig": {
"provider": "OpenAI",
"modelName": "GPT-4.1",
"baseUrl": "https://api.custom-llm.com/v1",
"apiKey": "sk-...",
"temperature": 0.2
},
"webToolsOverrides": {},
"agenticRag": True,
"languageDialectSwitcher": True,
"noiseCancellation": "<string>",
"cancelNoisePer": "<string>",
"minInterruptionDuration": 0.85,
"vadActivationThreshold": 0.55,
"enableAutoGainControl": True,
"sendDenoisedToStt": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentName: '<string>',
greetingMessage: '<string>',
greetingMessageType: '<string>',
preamble: '<string>',
pokeMessages: ['<string>'],
realTime: true,
silenceThreshold: 123,
interrupt: true,
outcome: '<string>',
outcomeResponseShape: {
type: 'object',
properties: {test: {type: 'number', description: 'Hello world from Hamsa AI!'}},
required: ['test']
},
webhookUrl: 'https://example.com/webhook',
webhookAuth: {authKey: 'Token', authSecret: 'Secret'},
voiceId: '<string>',
description: '<string>',
isTemplate: true,
icon: '<string>',
tools: {genderDetection: false, smartCallEnd: false},
params: {},
alignment: {greetingMessage: 'ltr', preamble: 'ltr'},
knowledgeBaseItemsIds: ['<string>'],
webToolsIds: ['<string>'],
voiceDictionaryIds: ['<string>'],
userInactivityTimeout: 17.5,
maxCallDuration: 315,
responseDelay: 800,
backgroundNoise: true,
waitForUserToSpeakFirst: 1,
thinkingVoice: true,
speakerIdentification: true,
llmConfig: {
provider: 'OpenAI',
modelName: 'GPT-4.1',
baseUrl: 'https://api.custom-llm.com/v1',
apiKey: 'sk-...',
temperature: 0.2
},
webToolsOverrides: {},
agenticRag: true,
languageDialectSwitcher: true,
noiseCancellation: '<string>',
cancelNoisePer: '<string>',
minInterruptionDuration: 0.85,
vadActivationThreshold: 0.55,
enableAutoGainControl: true,
sendDenoisedToStt: true
})
};
fetch('https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}', 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.tryhamsa.com/v1/voice-agents/{voiceAgentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agentName' => '<string>',
'greetingMessage' => '<string>',
'greetingMessageType' => '<string>',
'preamble' => '<string>',
'pokeMessages' => [
'<string>'
],
'realTime' => true,
'silenceThreshold' => 123,
'interrupt' => true,
'outcome' => '<string>',
'outcomeResponseShape' => [
'type' => 'object',
'properties' => [
'test' => [
'type' => 'number',
'description' => 'Hello world from Hamsa AI!'
]
],
'required' => [
'test'
]
],
'webhookUrl' => 'https://example.com/webhook',
'webhookAuth' => [
'authKey' => 'Token',
'authSecret' => 'Secret'
],
'voiceId' => '<string>',
'description' => '<string>',
'isTemplate' => true,
'icon' => '<string>',
'tools' => [
'genderDetection' => false,
'smartCallEnd' => false
],
'params' => [
],
'alignment' => [
'greetingMessage' => 'ltr',
'preamble' => 'ltr'
],
'knowledgeBaseItemsIds' => [
'<string>'
],
'webToolsIds' => [
'<string>'
],
'voiceDictionaryIds' => [
'<string>'
],
'userInactivityTimeout' => 17.5,
'maxCallDuration' => 315,
'responseDelay' => 800,
'backgroundNoise' => true,
'waitForUserToSpeakFirst' => 1,
'thinkingVoice' => true,
'speakerIdentification' => true,
'llmConfig' => [
'provider' => 'OpenAI',
'modelName' => 'GPT-4.1',
'baseUrl' => 'https://api.custom-llm.com/v1',
'apiKey' => 'sk-...',
'temperature' => 0.2
],
'webToolsOverrides' => [
],
'agenticRag' => true,
'languageDialectSwitcher' => true,
'noiseCancellation' => '<string>',
'cancelNoisePer' => '<string>',
'minInterruptionDuration' => 0.85,
'vadActivationThreshold' => 0.55,
'enableAutoGainControl' => true,
'sendDenoisedToStt' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.tryhamsa.com/v1/voice-agents/{voiceAgentId}"
payload := strings.NewReader("{\n \"agentName\": \"<string>\",\n \"greetingMessage\": \"<string>\",\n \"greetingMessageType\": \"<string>\",\n \"preamble\": \"<string>\",\n \"pokeMessages\": [\n \"<string>\"\n ],\n \"realTime\": true,\n \"silenceThreshold\": 123,\n \"interrupt\": true,\n \"outcome\": \"<string>\",\n \"outcomeResponseShape\": {\n \"type\": \"object\",\n \"properties\": {\n \"test\": {\n \"type\": \"number\",\n \"description\": \"Hello world from Hamsa AI!\"\n }\n },\n \"required\": [\n \"test\"\n ]\n },\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"authKey\": \"Token\",\n \"authSecret\": \"Secret\"\n },\n \"voiceId\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"icon\": \"<string>\",\n \"tools\": {\n \"genderDetection\": false,\n \"smartCallEnd\": false\n },\n \"params\": {},\n \"alignment\": {\n \"greetingMessage\": \"ltr\",\n \"preamble\": \"ltr\"\n },\n \"knowledgeBaseItemsIds\": [\n \"<string>\"\n ],\n \"webToolsIds\": [\n \"<string>\"\n ],\n \"voiceDictionaryIds\": [\n \"<string>\"\n ],\n \"userInactivityTimeout\": 17.5,\n \"maxCallDuration\": 315,\n \"responseDelay\": 800,\n \"backgroundNoise\": true,\n \"waitForUserToSpeakFirst\": 1,\n \"thinkingVoice\": true,\n \"speakerIdentification\": true,\n \"llmConfig\": {\n \"provider\": \"OpenAI\",\n \"modelName\": \"GPT-4.1\",\n \"baseUrl\": \"https://api.custom-llm.com/v1\",\n \"apiKey\": \"sk-...\",\n \"temperature\": 0.2\n },\n \"webToolsOverrides\": {},\n \"agenticRag\": true,\n \"languageDialectSwitcher\": true,\n \"noiseCancellation\": \"<string>\",\n \"cancelNoisePer\": \"<string>\",\n \"minInterruptionDuration\": 0.85,\n \"vadActivationThreshold\": 0.55,\n \"enableAutoGainControl\": true,\n \"sendDenoisedToStt\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentName\": \"<string>\",\n \"greetingMessage\": \"<string>\",\n \"greetingMessageType\": \"<string>\",\n \"preamble\": \"<string>\",\n \"pokeMessages\": [\n \"<string>\"\n ],\n \"realTime\": true,\n \"silenceThreshold\": 123,\n \"interrupt\": true,\n \"outcome\": \"<string>\",\n \"outcomeResponseShape\": {\n \"type\": \"object\",\n \"properties\": {\n \"test\": {\n \"type\": \"number\",\n \"description\": \"Hello world from Hamsa AI!\"\n }\n },\n \"required\": [\n \"test\"\n ]\n },\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"authKey\": \"Token\",\n \"authSecret\": \"Secret\"\n },\n \"voiceId\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"icon\": \"<string>\",\n \"tools\": {\n \"genderDetection\": false,\n \"smartCallEnd\": false\n },\n \"params\": {},\n \"alignment\": {\n \"greetingMessage\": \"ltr\",\n \"preamble\": \"ltr\"\n },\n \"knowledgeBaseItemsIds\": [\n \"<string>\"\n ],\n \"webToolsIds\": [\n \"<string>\"\n ],\n \"voiceDictionaryIds\": [\n \"<string>\"\n ],\n \"userInactivityTimeout\": 17.5,\n \"maxCallDuration\": 315,\n \"responseDelay\": 800,\n \"backgroundNoise\": true,\n \"waitForUserToSpeakFirst\": 1,\n \"thinkingVoice\": true,\n \"speakerIdentification\": true,\n \"llmConfig\": {\n \"provider\": \"OpenAI\",\n \"modelName\": \"GPT-4.1\",\n \"baseUrl\": \"https://api.custom-llm.com/v1\",\n \"apiKey\": \"sk-...\",\n \"temperature\": 0.2\n },\n \"webToolsOverrides\": {},\n \"agenticRag\": true,\n \"languageDialectSwitcher\": true,\n \"noiseCancellation\": \"<string>\",\n \"cancelNoisePer\": \"<string>\",\n \"minInterruptionDuration\": 0.85,\n \"vadActivationThreshold\": 0.55,\n \"enableAutoGainControl\": true,\n \"sendDenoisedToStt\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v1/voice-agents/{voiceAgentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentName\": \"<string>\",\n \"greetingMessage\": \"<string>\",\n \"greetingMessageType\": \"<string>\",\n \"preamble\": \"<string>\",\n \"pokeMessages\": [\n \"<string>\"\n ],\n \"realTime\": true,\n \"silenceThreshold\": 123,\n \"interrupt\": true,\n \"outcome\": \"<string>\",\n \"outcomeResponseShape\": {\n \"type\": \"object\",\n \"properties\": {\n \"test\": {\n \"type\": \"number\",\n \"description\": \"Hello world from Hamsa AI!\"\n }\n },\n \"required\": [\n \"test\"\n ]\n },\n \"webhookUrl\": \"https://example.com/webhook\",\n \"webhookAuth\": {\n \"authKey\": \"Token\",\n \"authSecret\": \"Secret\"\n },\n \"voiceId\": \"<string>\",\n \"description\": \"<string>\",\n \"isTemplate\": true,\n \"icon\": \"<string>\",\n \"tools\": {\n \"genderDetection\": false,\n \"smartCallEnd\": false\n },\n \"params\": {},\n \"alignment\": {\n \"greetingMessage\": \"ltr\",\n \"preamble\": \"ltr\"\n },\n \"knowledgeBaseItemsIds\": [\n \"<string>\"\n ],\n \"webToolsIds\": [\n \"<string>\"\n ],\n \"voiceDictionaryIds\": [\n \"<string>\"\n ],\n \"userInactivityTimeout\": 17.5,\n \"maxCallDuration\": 315,\n \"responseDelay\": 800,\n \"backgroundNoise\": true,\n \"waitForUserToSpeakFirst\": 1,\n \"thinkingVoice\": true,\n \"speakerIdentification\": true,\n \"llmConfig\": {\n \"provider\": \"OpenAI\",\n \"modelName\": \"GPT-4.1\",\n \"baseUrl\": \"https://api.custom-llm.com/v1\",\n \"apiKey\": \"sk-...\",\n \"temperature\": 0.2\n },\n \"webToolsOverrides\": {},\n \"agenticRag\": true,\n \"languageDialectSwitcher\": true,\n \"noiseCancellation\": \"<string>\",\n \"cancelNoisePer\": \"<string>\",\n \"minInterruptionDuration\": 0.85,\n \"vadActivationThreshold\": 0.55,\n \"enableAutoGainControl\": true,\n \"sendDenoisedToStt\": true\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"message": "success",
"data": {
"id": "<string>",
"agentName": "<string>",
"greetingMessage": "<string>",
"description": "<string>",
"preamble": "<string>",
"lang": "<string>",
"pokeMessages": [
"<string>"
],
"realTime": true,
"silenceThreshold": 123,
"interrupt": true,
"type": "<string>",
"outcome": "<string>",
"outcomeResponseShape": {
"type": "object",
"properties": {
"test": {
"type": "number",
"description": "Hello world from Hamsa AI!"
}
},
"required": [
"test"
]
},
"projectId": "<string>",
"apiKeyId": "<string>",
"voiceId": "<string>",
"voiceRecordId": "<string>",
"voiceRecord": {},
"collectionId": "<string>",
"isTemplate": true,
"icon": "<string>",
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
},
"params": {},
"alignment": {
"greetingMessage": "<string>",
"preamble": "<string>"
},
"tools": {
"genderDetection": true,
"smartCallEnd": true
},
"webToolsIds": [
"<string>"
],
"voiceDictionaryIds": [
"<string>"
],
"knowledgeBaseItemsIds": [
"<string>"
],
"webToolsOverrides": {},
"userInactivityTimeout": 123,
"maxCallDuration": 123,
"responseDelay": 123,
"backgroundNoise": true,
"waitForUserToSpeakFirst": 123,
"thinkingVoice": true,
"speakerIdentification": true,
"llmConfig": {
"provider": "OpenAI",
"modelName": "GPT-4.1",
"baseUrl": "https://api.custom-llm.com/v1",
"apiKey": "sk-...",
"temperature": 0.2
},
"noiseCancellation": "<string>",
"cancelNoisePer": "<string>",
"agenticRag": true,
"languageDialectSwitcher": true,
"minInterruptionDuration": 123,
"vadActivationThreshold": 123,
"enableAutoGainControl": true,
"sendDenoisedToStt": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '
Path Parameters
Body
Greeting Message can be customized by adding params like: {{name}}, to make the message more personal!
Preamble can be customized by adding params like: {{agentName}}, to make the prompt more specific and context aware!
ar, en The messages to say to the user when he doesn't respond!
A prompt to take the conversation and transform it to anything you like, like creating an article out of the conversation!
Recursive OpenAPI-style shape with 'type', 'properties', 'required', 'items', ...etc. Please refer to the OpenAPI Outcome Response Instructions above for more information.
{ "type": "object", "properties": { "test": { "type": "number", "description": "Hello world from Hamsa AI!" } }, "required": ["test"] }
"https://example.com/webhook"
Authorization header to be sent in this format: Authorization: [authKey] [authSecret]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Set the params you define in the greeting message or preamble fields here, the key is the same as the param and the value is the param value. Press 'Add new property' below to set the param name then press enter, after that add the value.
Show child attributes
Show child attributes
5 <= x <= 3030 <= x <= 600100 <= x <= 15000 <= x <= 2Configuration for the LLM (Large Language Model) used by the voice agent
Show child attributes
Show child attributes
0.2 <= x <= 1.50.2 <= x <= 0.9Was this page helpful?