Skip to main content

.NET SDK

The Orbit .NET SDK wraps the platform’s core API resources — messaging (SMS, WhatsApp, email), voice, contacts, campaigns, verify (OTP), and webhook signature verification — with typed async methods. It targets .NET 8.0 (LTS) and has zero external runtime dependencies.
Pre-publish — source-only. This SDK is not yet on NuGet — dotnet add package Orbit.Sdk fails today. Until first publish, vendor the source from the monorepo (packages/sdk-csharp/) or call the REST API directly. See .NET: core-scope, not full parity on the SDK index for exactly what is and isn’t wrapped, and the low-level client.RequestAsync(method, path, ...) escape hatch for uncovered routes (worked example below).

Installation

Or via Package Manager:

Client initialization

Or read the key from an environment variable (ORBIT_API_KEY):
Tune timeouts and retries with the direct constructor:
Inject a custom HttpClient (with handlers for OpenTelemetry, mTLS, etc.):
OrbitClient is safe for concurrent use across tasks — share a single instance per process (DI singleton).

Quickstart: send your first SMS

A runnable end-to-end — the key comes from ORBIT_API_KEY, never from source. Copy it into Program.cs and run it with dotnet run:
Point 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

client.Messages also exposes SendWhatsAppAsync, SendEmailAsync, and GetAsync.

Voice

Verify (one-time codes)

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:
A wrongly-typed or expired code reports 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). Still pending and the user didn’t get the code? Re-dispatch on the same id:

Contacts

Campaigns

Paginate a list

List endpoints are cursor-paginated — read meta.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:
The full pagination model (cursor vs. offset endpoints, page-size caps, and why cursors are not bookmarkable) is in the Pagination guide.

Error handling

All Orbit-originated errors inherit from OrbitError:
Every non-GET request automatically carries an Idempotency-Key header (GUID); override it per call with your own stable key (idempotencyKey: "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 through client.RequestAsync(method, path, ...). It returns the raw JSON body as a JsonElement. Fetch a segment by id:
The escape hatch carries the same auth, retry, and error model as the typed methods — treat it as a first-class client, not a fallback HttpClient.

Webhook signature verification