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
queued → sent → delivered), which is what a status poller or a
support lookup does:
client.Messages() also exposes SendWhatsApp and SendEmail; Get (above) fetches a message by id.
Voice
A call’s full lifecycle fits in one flow: place it, poll its status, then hang up.Get returns the same call record Create did — read Status off it as
it moves (queued → ringing → in-progress → completed):
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)
Resend re-dispatches the code
for a still-pending verification (same verification id), and GetDetail
returns the full verification record (the same payload the dashboard
verification drawer renders):
Contacts
Create returned —
fetch it, patch it (pointer fields are omitted from the request when nil),
and delete it:
Campaigns
client.Campaigns() also exposes Delete —
client.Campaigns().Delete(ctx, id) permanently removes a campaign by id
(returns no body).
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.
Webhook signature verification
Runnable examples
The package’sexamples/ directory holds self-contained, runnable end-to-end
files (each takes ORBIT_API_KEY / ORBIT_WEBHOOK_SECRET from the
environment): first SMS send, cursor pagination over GET /messages, the OTP
send+check round trip, a programmable outbound call with an answer_url
callback, and webhook signature verification against a signed test payload.
Run any of them with go run ./examples/<name>.go. The same shapes are also
walked task-by-task in the API recipes cookbook.