Skip to main content
POST
/
v1
/
voice-agents
/
phone-number
/
call
Call Voice Agent using Twilio custom phone number.
curl --request POST \
  --url https://api.tryhamsa.com/v1/voice-agents/phone-number/call \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "toNumber": "<string>",
  "phoneNumber": "+1234567890",
  "agentDetails": {
    "agentName": ""
  },
  "voiceAgentId": "d949f13f-40d2-4e48-ac86-b66633070603",
  "params": {}
}'
{
  "success": false,
  "message": "success",
  "data": {
    "voiceAgentId": "d949f13f-40d2-4e48-ac86-b66633070603",
    "jobId": "d949f13f-40d2-4e48-ac86-b66633070603"
  }
}

Authorizations

Authorization
string
header
required

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

application/json
  • Option 1
  • Option 2
toNumber
string
required

The number that you want to call

phoneNumber
string
required
Example:

"+1234567890"

voiceAgentId
string | null
required
Example:

"d949f13f-40d2-4e48-ac86-b66633070603"

params
object
required

Overriding params set in the voice agent's greeting message or preamble. Send when using voiceAgentId only.

agentDetails
object

Send agentDetails instead of voiceAgentId and params.

Response

Successful response

success
boolean
default:false
message
string
default:success
data
object
I