Go SDK
The Orbit Go SDK wraps the platform’s core API resources — messaging (SMS, WhatsApp, email), voice, contacts, campaigns, verify (OTP), and webhook signature verification — with typed methods. It requires Go 1.22+ and is safe for concurrent use across goroutines.Pre-publish — source-only. This SDK is not yet mirrored to the public
Go module repository —
go get github.com/devotel/orbit-go returns 404
today. Until first publish, vendor the source from the monorepo
(packages/sdk-go/) or call the REST API directly. See
Go: core-scope, not full parity on
the SDK index for exactly what is and isn’t wrapped, and the low-level
client.Request(ctx, method, path, ...) escape hatch for uncovered routes
(worked example below).Installation
Client initialization
The client reads the key straight from your environment — there is nofrom_env helper in Go; use os.Getenv:
Quickstart: send your first SMS
A runnable end-to-end — the key comes fromORBIT_API_KEY, never from
source. Copy it into main.go and run it with go run .:
ORBIT_API_KEY to a sandbox key prefixed dv_test_sk_ first — sandbox
sends are simulated, free, and never reach a carrier. Swap in your live key
(dv_live_sk_...) when you’re ready to send for real; the code does not
change.
The response shape above comes from the
Messages API reference — its language
tabs include this exact call.
Messaging
client.Messages() also exposes SendWhatsApp, SendEmail, and Get (fetch a message by id).
Voice
client.Voice() also exposes Get, List, and Hangup(callID) — place a call, poll its status, then hang up. All outbound calls route through the Orbit API; the SDK never selects a carrier.
Second example: verify OTP
The send-and-check round trip is the most common first integration on the platform. Two calls — the key is still justORBIT_API_KEY passed to
orbit.NewClient:
check.Data.Valid == false — it
never errors for a bad guess (only for transport/auth failures), so branch
on the flag. The Verify API reference
covers the full contract, and Starter examples
includes a complete OTP sign-in starter repo (orbit-otp-nextjs).
Verify (OTP)
client.Verify() also exposes Resend and GetDetail.
Contacts
client.Contacts() also exposes List, Get, Update, and Delete.
Campaigns
client.Campaigns() also exposes List, Get, Update, and Delete.
Paginate a list
List endpoints are cursor-paginated — readmeta.pagination.cursor and
meta.pagination.has_more off each response and pass the cursor back as a
query parameter until has_more is false. Page through SMS messages with
the escape hatch:
Error handling
All Orbit-originated errors are*orbit.Error. Inspect them with the helper predicates:
Idempotency-Key header (UUID v4); override it per call via orbit.SendSMSInput{ ..., IdempotencyKey: "job-7a3b9d-attempt-1" } when retrying from your own queue.
Covered route missing? Use the escape hatch
The typed resources wrap 8 core resources; the rest of the API — contact segments, event sinks, frequency caps, and everything else listed as out of scope on the SDK index — is reachable throughclient.Request(ctx, method, path, ...). It unmarshals the raw JSON body into whatever out you pass (a map[string]any when you have no typed struct). Fetch a segment by id:
http.Client.