curl --request PATCH \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "Single Prompt",
"name": "Updated Customer Support Agent",
"conversation": {
"greetingMessage": "Welcome! How may I assist you?",
"greetingMessageType": "TEXT",
"preamble": "You are a customer support assistant.",
"pokeMessages": [
"Are you still there?"
],
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
}
},
"voice": {
"voiceId": "en-US-Neural2-B",
"lang": "en"
},
"llm": {
"provider": "openai",
"model": "gpt-4-turbo",
"temperature": 0.8,
"baseUrl": "https://api.example.com",
"apiKey": "sk-..."
},
"callSettings": {
"noiseCancellation": "telephony_optimized",
"cancelNoisePer": "conversation",
"interrupt": true,
"responseDelay": 500,
"minInterruptionDuration": 0.6,
"vadActivationThreshold": 0.6,
"userInactivityTimeout": 20,
"maxCallDuration": 400,
"silenceThreshold": 1000,
"backgroundNoise": true,
"enableAutoGainControl": true,
"sendDenoisedToStt": true,
"waitForUserToSpeakFirst": 1,
"thinkingVoice": true,
"speakerIdentification": true,
"agenticRag": true,
"languageDialectSwitcher": true,
"genderDetection": true,
"smartCallEnd": true
},
"tools": [
{
"persistentId": "tool_123",
"toolId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
"version": 1,
"toolType": "FUNCTION",
"nodeId": "node_1",
"testResult": {},
"overrides": {}
}
],
"knowledgeBaseItemsIds": [
"48f7656f-098b-4c43-b165-7cfd2cc8ac30"
],
"voiceDictionaryIds": [
"48f7656f-098b-4c43-b165-7cfd2cc8ac30"
],
"phoneNumber": {
"type": "TWILIO",
"id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30"
},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {},
"workflow": {},
"outcomeResponseShape": {}
}
'{
"success": true,
"message": "Voice agent updated successfully",
"messageKey": "VoiceAgentUpdatedSuccessfully",
"data": {
"id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
"type": "Single Prompt",
"name": "Customer Support Agent",
"conversation": {
"greetingMessage": "Hello, how can I help you today?",
"greetingMessageType": null,
"preamble": "You are a helpful assistant.",
"pokeMessages": [],
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
}
},
"voice": {
"voiceId": "en-US-Neural2-A",
"voiceRecordId": null,
"voiceRecord": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provider": "<string>",
"language": "<string>",
"image": "<string>",
"languageCode": "<string>",
"voiceRecord": {}
},
"lang": "en",
"ttsParams": {}
},
"llm": {
"provider": "openai",
"model": "gpt-4",
"temperature": 0.2,
"baseUrl": null,
"apiKey": null
},
"callSettings": {
"noiseCancellation": "telephony_optimized",
"cancelNoisePer": "conversation",
"interrupt": true,
"responseDelay": 400,
"userInactivityTimeout": 15,
"maxCallDuration": 300,
"silenceThreshold": 800,
"backgroundNoise": false,
"thinkingVoice": false,
"speakerIdentification": false,
"agenticRag": false,
"languageDialectSwitcher": false,
"minInterruptionDuration": 0.5,
"vadActivationThreshold": 0.5,
"enableAutoGainControl": false,
"sendDenoisedToStt": false,
"genderDetection": false,
"smartCallEnd": false,
"waitForUserToSpeakFirst": 0
},
"tools": [
{}
],
"knowledgeBaseItemsIds": [],
"voiceDictionaryIds": [],
"phoneNumber": {
"type": "TWILIO",
"id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30"
},
"webhookUrl": null,
"webhookAuth": {},
"workflow": {},
"outcomeResponseShape": {},
"resolvedWebTools": [
{}
],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"account": {
"plan": "pro"
}
}
}Updates an existing voice agent with new configuration.
curl --request PATCH \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "Single Prompt",
"name": "Updated Customer Support Agent",
"conversation": {
"greetingMessage": "Welcome! How may I assist you?",
"greetingMessageType": "TEXT",
"preamble": "You are a customer support assistant.",
"pokeMessages": [
"Are you still there?"
],
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
}
},
"voice": {
"voiceId": "en-US-Neural2-B",
"lang": "en"
},
"llm": {
"provider": "openai",
"model": "gpt-4-turbo",
"temperature": 0.8,
"baseUrl": "https://api.example.com",
"apiKey": "sk-..."
},
"callSettings": {
"noiseCancellation": "telephony_optimized",
"cancelNoisePer": "conversation",
"interrupt": true,
"responseDelay": 500,
"minInterruptionDuration": 0.6,
"vadActivationThreshold": 0.6,
"userInactivityTimeout": 20,
"maxCallDuration": 400,
"silenceThreshold": 1000,
"backgroundNoise": true,
"enableAutoGainControl": true,
"sendDenoisedToStt": true,
"waitForUserToSpeakFirst": 1,
"thinkingVoice": true,
"speakerIdentification": true,
"agenticRag": true,
"languageDialectSwitcher": true,
"genderDetection": true,
"smartCallEnd": true
},
"tools": [
{
"persistentId": "tool_123",
"toolId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
"version": 1,
"toolType": "FUNCTION",
"nodeId": "node_1",
"testResult": {},
"overrides": {}
}
],
"knowledgeBaseItemsIds": [
"48f7656f-098b-4c43-b165-7cfd2cc8ac30"
],
"voiceDictionaryIds": [
"48f7656f-098b-4c43-b165-7cfd2cc8ac30"
],
"phoneNumber": {
"type": "TWILIO",
"id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30"
},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {},
"workflow": {},
"outcomeResponseShape": {}
}
'{
"success": true,
"message": "Voice agent updated successfully",
"messageKey": "VoiceAgentUpdatedSuccessfully",
"data": {
"id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
"type": "Single Prompt",
"name": "Customer Support Agent",
"conversation": {
"greetingMessage": "Hello, how can I help you today?",
"greetingMessageType": null,
"preamble": "You are a helpful assistant.",
"pokeMessages": [],
"params": {},
"alignment": {
"greetingMessage": "ltr",
"preamble": "ltr"
}
},
"voice": {
"voiceId": "en-US-Neural2-A",
"voiceRecordId": null,
"voiceRecord": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provider": "<string>",
"language": "<string>",
"image": "<string>",
"languageCode": "<string>",
"voiceRecord": {}
},
"lang": "en",
"ttsParams": {}
},
"llm": {
"provider": "openai",
"model": "gpt-4",
"temperature": 0.2,
"baseUrl": null,
"apiKey": null
},
"callSettings": {
"noiseCancellation": "telephony_optimized",
"cancelNoisePer": "conversation",
"interrupt": true,
"responseDelay": 400,
"userInactivityTimeout": 15,
"maxCallDuration": 300,
"silenceThreshold": 800,
"backgroundNoise": false,
"thinkingVoice": false,
"speakerIdentification": false,
"agenticRag": false,
"languageDialectSwitcher": false,
"minInterruptionDuration": 0.5,
"vadActivationThreshold": 0.5,
"enableAutoGainControl": false,
"sendDenoisedToStt": false,
"genderDetection": false,
"smartCallEnd": false,
"waitForUserToSpeakFirst": 0
},
"tools": [
{}
],
"knowledgeBaseItemsIds": [],
"voiceDictionaryIds": [],
"phoneNumber": {
"type": "TWILIO",
"id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30"
},
"webhookUrl": null,
"webhookAuth": {},
"workflow": {},
"outcomeResponseShape": {},
"resolvedWebTools": [
{}
],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"account": {
"plan": "pro"
}
}
}Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token
UUID of the voice agent.
"48f7656f-098b-4c43-b165-7cfd2cc8ac30"
All fields are optional for updates. Include only the fields you want to update.
Type of voice agent.
Single Prompt, Flow Agent "Single Prompt"
Name of the voice agent (max 150 characters).
150"Updated Customer Support Agent"
Conversation settings (partial update supported).
Show child attributes
Voice settings (partial update supported).
Show child attributes
LLM configuration (partial update supported).
Show child attributes
Call settings (partial update supported).
Show child attributes
Web tools (replaces existing tools).
Show child attributes
Knowledge base item UUIDs (replaces existing).
["48f7656f-098b-4c43-b165-7cfd2cc8ac30"]Voice dictionary UUIDs (replaces existing).
["48f7656f-098b-4c43-b165-7cfd2cc8ac30"]Show child attributes
"https://example.com/webhook"
Was this page helpful?