Java SDK
The Orbit Java 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 JDK 11+ and has zero external runtime dependencies.Pre-publish — source-only. This SDK is not yet on Maven Central — the
dependencies below describe the future registry shape. Until first
publish, vendor the source from the monorepo (
packages/sdk-java/) or
call the REST API directly. See
Java: core-scope, not full parity
on the SDK index for exactly what is and isn’t wrapped, and the low-level
client.request(method, path, ...) escape hatch for uncovered routes
(worked example below).Installation
No registry dependency block is live yet — nothing here resolves today. Vendor the SDK source from the monorepo (packages/sdk-java/) and build it into
your project, or call the REST API directly with any HTTP client until the first
Maven Central release ships (coordinates change).
Client initialization
ORBIT_API_KEY):
OrbitClient is safe for concurrent use across threads — share a single instance per JVM.
Quickstart: send your first SMS
A runnable end-to-end — the key comes fromORBIT_API_KEY, never from
source. Copy it into Main.java and run it:
ORBIT_API_KEY at 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 (or hand it off with a blind transfer).getCall returns the same call
record createCall did — read status off it as it moves (queued →
ringing → in-progress → completed):
listCalls(null) for no filters):
Verify (OTP)
The send-and-check round trip is the most common first integration on the platform — here as a complete flow. Send the code, keep the returned verification id, and check the code the user typed in against it:valid: false — it never throws
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 ships a complete
OTP sign-in starter repo (orbit-otp-nextjs).
Resend the code for a still-pending verification — the same verification id
is reused, so no new state is created:
client.request) shown below;
the verification detail endpoint is GET /api/v1/verify/{id}/detail.
Contacts
The full contact lifecycle reads off the idcreate returned — fetch it,
patch it, tag it, page the directory, and delete it:
Campaigns
Create a campaign, trigger its send, then re-fetch it to watch the status progress (draft → sending → completed):
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 param until has_more is false. Page through SMS messages with the
escape hatch:
Error handling
All Orbit-originated errors inherit fromOrbitError:
Idempotency-Key header (UUIDv4); pass your own stable key as the fourth argument to sendSms when retrying from your own queue (client.messages.sendSms("+14155552671", "...", null, "job-7a3b9d-attempt-1")).
Covered route missing? Use the escape hatch
The typed clients 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(method, path, ...). It returns the raw JSON body as a Map<String, Object>. Fetch a segment by id:
HttpClient.
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.
Compile the SDK with mvn package, then java -cp target/orbit-sdk-*.jar:examples <ExampleName>.