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 Go SDK for the Vobiz Voice API. Make outbound calls, manage SIP trunks, handle phone numbers, and construct programmatic XML workflows synchronously in Go.
Source code: vobiz-ai/vobiz-go-sdk
Installation
Clone the repository and integrate it locally:
git clone https://github.com/vobiz-ai/Vobiz-Go-SDK.git
cd Vobiz-Go-SDK
go mod tidy
Quick start
Place an outbound call. When the call connects, Vobiz pings your AnswerURL endpoint, and you must respond with a VobizXML payload.
package main
import (
"fmt"
"github.com/vobiz-ai/vobiz-go-sdk/client"
"github.com/vobiz-ai/vobiz-go-sdk/services/calls"
)
func main() {
c := client.New("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")
call, err := calls.New(c).Create(&calls.CreateParams{
To: "+1xxxxxxxxxx",
AnswerURL: "https://yourserver.com/answer",
AnswerMethod: "POST",
})
if err != nil {
panic(err)
}
fmt.Println("Call UUID:", call.RequestUUID)
}
Authentication
The Go client requires your Auth ID and Auth Token. Find both in the Vobiz Console.
import "github.com/vobiz-ai/vobiz-go-sdk/client"
c := client.New("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")
VobizXML
The SDK ships with a strongly typed xml builder that generates valid VobizXML directly. It provides code completion for all available verbs (Gather, Record, Dial).
import "github.com/vobiz-ai/vobiz-go-sdk/xml"
response := xml.NewResponse()
response.AddSpeak("Welcome to Vobiz!", "WOMAN", "en-US")
response.AddRecord(xml.RecordParams{
Action: "https://yourserver.com/recording",
MaxLength: 30,
PlayBeep: true,
})
fmt.Println(response.ToXML())
Common operations
Live audio routing
svc := calls.New(c)
svc.Play("call-uuid", &calls.PlayParams{
URLs: []string{"https://example.com/audio.mp3"},
Legs: "aleg",
})
Conferences
import "github.com/vobiz-ai/vobiz-go-sdk/services/conferences"
svc := conferences.New(c)
// Kick a member
svc.Member.Delete("conference-name", "member-id")
// Start silent recording of the entire bridge
svc.Record("conference-name", &conferences.RecordParams{ FileFormat: "mp3" })
Resources