Skip to content
CloudVNO

Make a Call

Make outbound phone calls using the CloudVNO Voice API.

Make an Outbound Call

call = client.calls.create(
    from_="+14155551234",
    to="+12125559876",
    url="https://yourapp.com/call-handler"  # Webhook for call instructions
)
print(f"Call SID: {call.sid}")
const call = await client.calls.create({
  from: '+14155551234',
  to: '+12125559876',
  url: 'https://yourapp.com/call-handler',
});
curl -X POST https://api.cloudvno.com/v1/calls \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d from="+14155551234" \
  -d to="+12125559876" \
  -d url="https://yourapp.com/call-handler"

Call Handler Webhook

When the call connects, CloudVNO fetches your url. Respond with XML:

@app.route("/call-handler", methods=["POST"])
def call_handler():
    return Response("""
    <?xml version="1.0" encoding="UTF-8"?>
    <Response>
        <Say voice="alice">Hello! Thanks for calling. Press 1 for sales, 2 for support.</Say>
        <Gather numDigits="1" action="/handle-keypress">
            <Say>Please press a key now.</Say>
        </Gather>
    </Response>
    """, mimetype="text/xml")

Call Parameters

ParameterTypeRequiredDescription
fromstringYesYour CloudVNO number (E.164)
tostringYesDestination number (E.164)
urlstringYesWebhook URL for call instructions
status_callbackURLNoWebhook for call status events
recordbooleanNoRecord the entire call
timeoutintegerNoSeconds to wait for answer (default: 30)
machine_detectionstringNoEnable to detect answering machines

Monitor Call Status

call = client.calls(call_sid).fetch()
print(f"Duration: {call.duration}s")
print(f"Status: {call.status}")
print(f"Price: {call.price} {call.price_unit}")