curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/twilio/call \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"toNumber": "<string>",
"twilioPhoneNumber": "+1234567890",
"agentDetails": {
"agentName": ""
},
"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>",
"callParams": {
"machineNumber": "+1234567890",
"userNumber": "+1234567890"
},
"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"
}
}
curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/twilio/call \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"toNumber": "<string>",
"twilioPhoneNumber": "+1234567890",
"agentDetails": {
"agentName": ""
},
"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>",
"callParams": {
"machineNumber": "+1234567890",
"userNumber": "+1234567890"
},
"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"
}
}
Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token <api-key>'
Successful response
The response is of type object
.