Skip to main content
The official Ruby SDK for the Vobiz Voice API. Make outbound calls, manage SIP trunks, handle phone numbers, and drive live call flows directly from your Ruby on Rails or native Ruby stack. Source code: vobiz-ai/Vobiz-Ruby-SDK

Installation

Requires Ruby >= 3.3.0. The SDK is distributed from its GitHub repo (not RubyGems). Clone it, then reference it by path in your Gemfile:
Then run 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.

Authentication

The Ruby client uses your Auth ID and Auth Token. Find both in the Vobiz Console. Pass your Auth ID as api_key (mapped to the X-Auth-ID header) and your Auth Token as auth_token (mapped to X-Auth-Token). It is recommended to load credentials from environment variables:
Most API methods also take your auth_id as a parameter:

VobizXML

When Vobiz calls your answer_url, your webhook must respond with a VobizXML document that defines the call flow. The gem ships a builder at Vobiz::XML (require "vobiz/xml") - each add_* returns the created child for nesting, and keyword args map to VobizXML attributes:
Prefer the builder, but returning a raw VobizXML string also works. See the VobizXML reference for all verbs and attributes.

Common operations

Live call text-to-speech

Recordings

DID phone management

Error handling

The SDK raises Vobiz::ApiError for any non-2xx response. Inspect the exception for the status code and raw body:

Resources