API Documentation
SDK Documentation
Voice Enablement
Transcription Routes
Text to Speech Routes
Voice Agents Routes
Voice Agents Conversations Routes
AI Content Routes
Project Routes
API Statistics Routes
Start a Call for a Conversation Route
curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/call \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"toNumber": "<string>",
"fromNumber": "+18449292835",
"agentDetails": {},
"voiceAgentId": "<string>",
"params": {},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
}
}'
{
"success": false,
"message": "success",
"data": {
"id": "<string>",
"title": "<string>",
"model": "<string>",
"type": "<string>",
"processingType": "<string>",
"webhookUrl": "<string>",
"totalCost": 123,
"usageTime": "<string>",
"fromLng": "<string>",
"toLng": "<string>",
"mediaUrl": "<string>",
"jobResponse": {},
"fromScript": "<string>",
"toScript": "<string>",
"status": "<string>",
"relevantJobId": "<string>",
"agentDetails": {
"id": "<string>",
"agentName": "<string>",
"greetingMessage": "<string>",
"description": "<string>",
"preamble": "<string>",
"lang": "<string>",
"pokeMessages": [
"<string>"
],
"realTime": true,
"silenceThreshold": 123,
"interrupt": true,
"outcome": "<string>",
"projectId": "<string>",
"apiKeyId": "<string>",
"voiceRecordId": "<string>",
"voiceRecord": {},
"tools": {
"id": "<string>",
"calendarName": "<string>",
"accessToken": "<string>",
"refreshToken": "<string>",
"freeSlots": {
"Monday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Tuesday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Wednesday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Thursday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Friday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Saturday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Sunday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
]
},
"meetingDuration": 123,
"timezone": "<string>",
"voiceAgentToolsId": "<string>",
"calendarId": "<string>",
"eventTitle": "<string>"
},
"params": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"apiKeyId": "<string>",
"billingId": "<string>",
"systemModelKey": "<string>",
"voiceAgentId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
Authorizations
Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token <api-key>'
Body
The number that you want to call
+18449292835
, +18558961879
Params set in the voice agent's greeting message or preamble. Send when using voiceAgentId only.
Send agentDetails instead of voiceAgentId and params.
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!
The silence threshold in milliseconds. Minimum value is 1 millisecond.
x >= 1
A prompt to take the conversation and transform it to anything you like, like creating an article out of the conversation!
You can find predefined voices in the voice agents dashboard, under the language tab
1f3396aa-24e3-4523-b4ef-7dd4adb8fab9
, 29709a36-7703-497f-b6e5-0d39b873f77d
, 37665327-bfc7-4edf-a362-596a379865dc
, 60ef35b1-056a-47d9-8f8f-6571f2106560
, 8f14b3ee-beb6-4f9a-9819-02b45f7d48ff
, a2404aca-2c6d-47c7-ae9c-5ea317a30e60
, b1d24f8c-6d60-4fb5-8d06-708ba1bc89c2
, d23c0832-a642-4a59-8e93-fd0924abc46e
, d981c03a-2868-4de2-b097-e11ec231413c
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.
Send it only if the tools.googleCalendar is true.
The calendar id from the Google Calendar integration response.
A customized event title to be written to the booked meeting by the system.
The calendar name from the Google Calendar integration response.
The access token from the Google Calendar integration response.
The refresh token from the Google Calendar integration APIs.
The meeting duration in minutes. Meeting duration should be less than the difference between the from and to times.
Pacific/Niue
, Pacific/Pago_Pago
, Pacific/Honolulu
, Pacific/Rarotonga
, Pacific/Tahiti
, Pacific/Marquesas
, America/Adak
, Pacific/Gambier
, America/Anchorage
, America/Juneau
, America/Metlakatla
, America/Nome
, America/Sitka
, America/Yakutat
, Pacific/Pitcairn
, America/Dawson
, America/Dawson_Creek
, America/Creston
, America/Whitehorse
, America/Phoenix
, America/Fort_Nelson
, America/Vancouver
, America/Los_Angeles
, America/Tijuana
, America/Hermosillo
, Pacific/Galapagos
, America/Boise
, America/Denver
, America/Inuvik
, America/Yellowknife
, America/Cambridge_Bay
, America/Ojinaga
, America/Edmonton
, Pacific/Easter
, America/Mazatlan
, America/Chihuahua
, America/Belize
, America/Guatemala
, America/Costa_Rica
, America/Managua
, America/Regina
, America/El_Salvador
, America/Swift_Current
, America/Tegucigalpa
, America/Rio_Branco
, America/Eirunepe
, America/Cancun
, America/Atikokan
, America/Panama
, America/Jamaica
, America/Bogota
, America/Lima
, America/Bahia_Banderas
, America/North_Dakota/Beulah
, America/Winnipeg
, America/Matamoros
, America/Menominee
, America/Merida
, America/Mexico_City
, America/Monterrey
, America/Indiana/Knox
, America/North_Dakota/New_Salem
, America/Rankin_Inlet
, America/Resolute
, America/Rainy_River
, America/Indiana/Tell_City
, America/North_Dakota/Center
, America/Chicago
, America/Guayaquil
, America/Boa_Vista
, America/Campo_Grande
, America/Cuiaba
, America/Manaus
, America/Porto_Velho
, America/Barbados
, America/Blanc-Sablon
, America/Curacao
, America/Martinique
, America/Port_of_Spain
, America/Puerto_Rico
, America/Santo_Doming
, America/La_Paz
, America/Caracas
, America/Indiana/Vevay
, America/Indiana/Vincennes
, America/Grand_Turk
, America/Detroit
, America/Iqaluit
, America/Indiana/Indianapolis
, America/Kentucky/Louisville
, America/Indiana/Marengo
, America/Kentucky/Monticello
, America/Nassau
, America/Nipigon
, America/New_York
, America/Pangnirtung
, America/Indiana/Petersburg
, America/Port-au-Prince
, America/Thunder_Bay
, America/Toronto
, America/Indiana/Winamac
, America/Guyana
, America/Havana
, America/Asuncion
, America/Santiago
, America/Argentina/Buenos_Aires
, America/Argentina/Jujuy
, America/Argentina/Catamarca
, America/Argentina/Cordoba
, America/Argentina/La_Rioja
, America/Argentina/Mendoza
, America/Argentina/Rio_Gallegos
, America/Argentina/Salta
, America/Argentina/San_Luis
, America/Argentina/San_Juan
, America/Argentina/Tucuman
, America/Argentina/Ushuaia
, Atlantic/Bermuda
, America/Halifax
, America/Glace_Bay
, America/Goose_Bay
, America/Moncton
, America/Thule
, America/Araguaina
, America/Bahia
, America/Belem
, America/Maceio
, America/Recife
, America/Sao_Paulo
, America/Santarem
, America/Fortaleza
, Antarctica/Palmer
, America/Punta_Arenas
, Antarctica/Rothera
, America/Paramaribo
, America/Montevideo
, Atlantic/Stanley
, America/Cayenne
, America/St_Johns
, America/Nuuk
, America/Miquelon
, America/Noronha
, Atlantic/South_Georgia
, Atlantic/Cape_Verde
, Atlantic/Azores
, America/Scoresbysund
, UTC
, Etc/GMT
, Africa/Abidjan
, Africa/Accra
, Africa/Bissau
, America/Danmarkshavn
, Africa/Monrovia
, Atlantic/Reykjavik
, Africa/Sao_Tome
, Europe/London
, Africa/Lagos
, Africa/Ndjamena
, Atlantic/Canary
, Europe/Lisbon
, Atlantic/Madeira
, Atlantic/Faroe
, Africa/El_Aaiun
, Europe/Dublin
, Africa/Casablanca
, Africa/Algiers
, Africa/Tunis
, Africa/Cairo
, Europe/Kaliningrad
, Africa/Tripoli
, Antarctica/Troll
, Africa/Windhoek
, Africa/Juba
, Africa/Maputo
, Africa/Khartoum
, Europe/Amsterdam
, Europe/Andorra
, Europe/Belgrade
, Europe/Berlin
, Europe/Brussels
, Europe/Budapest
, Europe/Warsaw
, Europe/Vienna
, Europe/Gibraltar
, Europe/Copenhagen
, Europe/Luxembourg
, Europe/Madrid
, Europe/Malta
, Europe/Monaco
, Europe/Oslo
, Europe/Paris
, Europe/Prague
, Europe/Rome
, Africa/Ceuta
, Europe/Stockholm
, Europe/Tirane
, Europe/Zurich
, Africa/Johannesburg
, Europe/Volgograd
, Africa/Nairobi
, Asia/Amman
, Europe/Athens
, Asia/Beirut
, Europe/Bucharest
, Europe/Vilnius
, Asia/Gaza
, Asia/Damascus
, Europe/Zaporozhye
, Europe/Kiev
, Europe/Chisinau
, Asia/Nicosia
, Europe/Riga
, Europe/Sofia
, Europe/Tallinn
, Europe/Uzhgorod
, Asia/Hebron
, Europe/Helsinki
, Asia/Jerusalem
, Europe/Kirov
, Europe/Minsk
, Europe/Moscow
, Europe/Simferopol
, Asia/Baghdad
, Asia/Qatar
, Asia/Riyadh
, Antarctica/Syowa
, Europe/Istanbul
, Asia/Famagusta
, Asia/Baku
, Asia/Yerevan
, Europe/Astrakhan
, Asia/Tbilisi
, Indian/Mauritius
, Asia/Dubai
, Indian/Reunion
, Europe/Samara
, Europe/Saratov
, Indian/Mahe
, Europe/Ulyanovsk
, Asia/Kabul
, Asia/Tehran
, Asia/Yekaterinburg
, Asia/Aqtau
, Asia/Aqtobe
, Asia/Atyrau
, Asia/Qyzylorda
, Asia/Oral
, Indian/Maldives
, Antarctica/Mawson
, Asia/Karachi
, Asia/Dushanbe
, Asia/Ashgabat
, Asia/Samarkand
, Asia/Tashkent
, Indian/Kerguelen
, Asia/Kolkata
, Asia/Colombo
, Asia/Kathmandu
, Asia/Dhaka
, Asia/Thimphu
, Antarctica/Vostok
, Asia/Almaty
, Asia/Qostanay
, Indian/Chagos
, Asia/Bishkek
, Asia/Omsk
, Asia/Urumqi
, Indian/Cocos
, Asia/Yangon
, Asia/Barnaul
, Antarctica/Davis
, Asia/Jakarta
, Asia/Pontianak
, Asia/Bangkok
, Asia/Ho_Chi_Minh
, Asia/Krasnoyarsk
, Asia/Novokuznetsk
, Asia/Novosibirsk
, Indian/Christmas
, Asia/Tomsk
, Asia/Hovd
, Asia/Brunei
, Asia/Hong_Kong
, Australia/Perth
, Asia/Irkutsk
, Asia/Macau
, Asia/Shanghai
, Asia/Kuala_Lumpur
, Asia/Kuching
, Asia/Singapore
, Asia/Taipei
, Asia/Ulaanbaatar
, Asia/Choibalsan
, Asia/Manila
, Asia/Makassar
, Australia/Eucla
, Asia/Jayapura
, Asia/Dili
, Asia/Pyongyang
, Asia/Seoul
, Pacific/Palau
, Asia/Khandyga
, Asia/Chita
, Asia/Yakutsk
, Asia/Tokyo
, Australia/Adelaide
, Australia/Broken_Hill
, Australia/Darwin
, Asia/Vladivostok
, Asia/Ust-Nera
, Antarctica/Macquarie
, Australia/Melbourne
, Australia/Sydney
, Australia/Hobart
, Australia/Brisbane
, Australia/Lindeman
, Antarctica/DumontDUrville
, Pacific/Port_Moresby
, Pacific/Chuuk
, Pacific/Guam
, Australia/Lord_Howe
, Pacific/Bougainville
, Pacific/Efate
, Antarctica/Casey
, Pacific/Kosrae
, Asia/Magadan
, Pacific/Noumea
, Pacific/Norfolk
, Pacific/Pohnpei
, Asia/Sakhalin
, Pacific/Guadalcanal
, Asia/Srednekolymsk
, Asia/Anadyr
, Pacific/Kwajalein
, Pacific/Majuro
, Pacific/Nauru
, Pacific/Auckland
, Pacific/Tarawa
, Asia/Kamchatka
, Pacific/Funafuti
, Pacific/Wallis
, Pacific/Wake
, Pacific/Fiji
, Pacific/Chatham
, Pacific/Apia
, Pacific/Enderbury
, Pacific/Fakaofo
, Pacific/Tongatapu
Choose at least one day with time slots, you can choose what days to send and what days to leave!
"https://example.com/webhook"
Response
The voice record object which is connected to this agent.
The tools that are created for this agent. This includes the Google Calendar Settings.
The access token from the Google Calendar integration APIs.
The refresh token from the Google Calendar integration APIs.
The parameters that are created for this agent.
curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/call \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"toNumber": "<string>",
"fromNumber": "+18449292835",
"agentDetails": {},
"voiceAgentId": "<string>",
"params": {},
"webhookUrl": "https://example.com/webhook",
"webhookAuth": {
"authKey": "Token",
"authSecret": "Secret"
}
}'
{
"success": false,
"message": "success",
"data": {
"id": "<string>",
"title": "<string>",
"model": "<string>",
"type": "<string>",
"processingType": "<string>",
"webhookUrl": "<string>",
"totalCost": 123,
"usageTime": "<string>",
"fromLng": "<string>",
"toLng": "<string>",
"mediaUrl": "<string>",
"jobResponse": {},
"fromScript": "<string>",
"toScript": "<string>",
"status": "<string>",
"relevantJobId": "<string>",
"agentDetails": {
"id": "<string>",
"agentName": "<string>",
"greetingMessage": "<string>",
"description": "<string>",
"preamble": "<string>",
"lang": "<string>",
"pokeMessages": [
"<string>"
],
"realTime": true,
"silenceThreshold": 123,
"interrupt": true,
"outcome": "<string>",
"projectId": "<string>",
"apiKeyId": "<string>",
"voiceRecordId": "<string>",
"voiceRecord": {},
"tools": {
"id": "<string>",
"calendarName": "<string>",
"accessToken": "<string>",
"refreshToken": "<string>",
"freeSlots": {
"Monday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Tuesday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Wednesday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Thursday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Friday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Saturday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
],
"Sunday": [
[
{
"from": "<string>",
"to": "<string>"
}
]
]
},
"meetingDuration": 123,
"timezone": "<string>",
"voiceAgentToolsId": "<string>",
"calendarId": "<string>",
"eventTitle": "<string>"
},
"params": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"apiKeyId": "<string>",
"billingId": "<string>",
"systemModelKey": "<string>",
"voiceAgentId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}