Skip to main content
The Java SDK provides blocking and CompletableFuture clients for Torpedo’s email and SMS API.

Install

Java 17 or newer is required.

Create a client

Create one client and reuse it. Clients and resource objects are thread-safe.

Send email

Send a batch

Send SMS

If your workspace has an approved sender ID, pass it with .from(...). It must match exactly, including capitalization:
Omit from to use your default sender ID. See Sender ID for the full rules.

Verify a phone number

Send a one-time code over WhatsApp, then check what the user types:
torpedo.verify() also has resend(id, channel), report(id), cancel(id), get(id) and list(ListVerificationsOptions). See Verify phone numbers on WhatsApp.

Async calls

Cancelling the returned future cancels the active HTTP request and prevents later retries.

Pagination

Errors and retries

The SDK retries network errors, 429, and 5xx responses three times by default. Every send has one idempotency key that is reused across retry attempts. Configure .timeout(Duration) and .maxRetries(int) on the client builder.

Verify webhooks

Always pass the raw request bytes before JSON parsing.