API Documentation
SDK Documentation
Voice Enablement
Transcription Routes
Text to Speech Routes
Real Time Routes
Twilio Phone Numbers Routes
Voice Agents Routes
Voice Agents Conversations Routes
AI Content Routes
Project Routes
API Statistics Routes
Twilio Phone Numbers Routes
Add Twilio Number to a User Route
POST
/
v1
/
voice-agents
/
twilio
/
phone-number
curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/twilio/phone-number \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"phoneNumber": "+9700000000",
"label": "Support Line",
"twilioNumberSid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"twilioAccountSid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"twilioAuthToken": "your_twilio_auth_token"
}'
{
"success": true,
"message": "Success",
"data": {
"id": "d949f13f-40d2-4e48-ac86-b66633070603",
"number": "+9700000000",
"label": "My Twilio Number",
"numberSid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"isActive": true,
"userId": "d949f13f-40d2-4e48-ac86-b66633070603",
"voiceAgentId": null,
"createdAt": "2023-01-01T12:00:00Z",
"updatedAt": "2023-02-01T12:00:00Z"
}
}
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
application/json
Response
200
application/json
Successful response
The response is of type object
.
curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/twilio/phone-number \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"phoneNumber": "+9700000000",
"label": "Support Line",
"twilioNumberSid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"twilioAccountSid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"twilioAuthToken": "your_twilio_auth_token"
}'
{
"success": true,
"message": "Success",
"data": {
"id": "d949f13f-40d2-4e48-ac86-b66633070603",
"number": "+9700000000",
"label": "My Twilio Number",
"numberSid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"isActive": true,
"userId": "d949f13f-40d2-4e48-ac86-b66633070603",
"voiceAgentId": null,
"createdAt": "2023-01-01T12:00:00Z",
"updatedAt": "2023-02-01T12:00:00Z"
}
}
Assistant
Responses are generated using AI and may contain mistakes.