Go SDK
Go SDK for Sautikit. Install via go get, place calls with client.Calls.Create(). Preview: pin your version.
The Sautikit Go SDK is a minimal, context-aware client for placing calls, checking call status, and managing phone numbers. It provides strong types, error handling via the error interface, and works with Go 1.22+.
go get github.com/sautikit/sautikit-goUpdate your go.mod to pin the version:
require github.com/sautikit/sautikit-go v0.x.y
Place an outbound call and get the call ID back:
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/sautikit/sautikit-go"
)
func main() {
ctx := context.Background()
client := sautikit.NewClient(os.Getenv("SAUTIKIT_API_KEY"))
call, err := client.Calls.Create(ctx, &sautikit.CreateCallRequest{
From: "+254712345678",
To: []string{"+254700000001"},
})
if err != nil {
log.Fatalf("Failed to create call: %v", err)
}
fmt.Printf("Call placed. ID: %s, Status: %s\n", call.CallID, call.Status)
}The response includes:
{
"call_id": "9d2b1f53-8c0e-4f1d-9a6b-5d3a8c47e9f0",
"pbx_session_id": "HD_1a2b3c",
"status": "ringing",
"events_url": "/v1/calls/9d2b1f53-8c0e-4f1d-9a6b-5d3a8c47e9f0/events"
}The SDK reads your API key from the SAUTIKIT_API_KEY environment variable by default:
export SAUTIKIT_API_KEY="eyJ..."Or pass it to the constructor:
client := sautikit.NewClient("eyJ...")Preview: semver pinning recommended. The SDK's public API may change before v1.0. Pin your version in go.mod:
require github.com/sautikit/sautikit-go v0.x.y
Run go get -u to upgrade within your pinned major version.
Subscribe to releases on GitHub to stay informed of breaking changes.