Documentation Index
Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt
Use this file to discover all available pages before exploring further.
The official Ruby SDK for the Vobiz Voice API. Make outbound calls, manage SIP trunks, handle phone numbers, and construct programmatic XML workflows directly from your Ruby on Rails or native Ruby stack.
Source code: vobiz-ai/Vobiz-Ruby-SDK
Installation
Clone the repository directly into your workspace:
git clone https://github.com/vobiz-ai/Vobiz-Ruby-SDK.git
cd Vobiz-Ruby-SDK
bundle install
Quick start
Place an outbound call. When the call connects, Vobiz queries your answer_url webhook, which must return a valid VobizXML document.
require 'vobiz'
client = Vobiz::Client.new
call = client.calls.create(
from: '+1xxxxxxxxxx',
to: '+1xxxxxxxxxx',
answer_url: 'https://yourserver.com/answer',
answer_method: 'POST',
hangup_url: 'https://yourserver.com/hangup',
hangup_method: 'POST'
)
puts "Call UUID: #{call[:request_uuid]}"
Authentication
The Ruby client uses your Auth ID and Auth Token. Find both in the Vobiz Console.
Initialize the client automatically using environment variables:
require 'vobiz'
client = Vobiz::Client.new
Or pass credentials explicitly:
client = Vobiz::Client.new('YOUR_AUTH_ID', 'YOUR_AUTH_TOKEN')
VobizXML
Use the object-oriented XML::Response builder. Instead of concatenating raw XML strings, instantiate elements like add_speak or add_record and render with to_xml - your webhooks will always be schema-compliant.
require 'vobiz/xml'
response = Vobiz::XML::Response.new
response.add_speak('Welcome to Vobiz!', voice: 'WOMAN', language: 'en-US')
response.add_record(action: 'https://yourserver.com/recording', max_length: 30)
puts response.to_xml
Common operations
Live call mutators and storage
# Inject TTS dynamically into a live call
client.calls.speak_text('call-uuid', text: 'Hello dynamically!', voice: 'WOMAN', language: 'en-US')
# List recordings via native pagination
recordings = client.recordings.list
recordings.each { |rec| puts rec[:recording_url] }
DID phone management
# Search the inventory
available = client.numbers.search(country_iso: 'US', type: 'local')
# Provision a number
number = client.numbers.purchase(number: '+12025550123')
Resources