Skip to Content
Quickstart

Quickstart

Send your first email, SMS, or WhatsApp message.

Get an API key

Create an API key in the dashboard. Keys start with rt_ and are shown once. Store it in your environment:

RETRANSMIT_API_KEY=rt_xxxxxxxxxxxxxxxx

Install the SDK (optional)

The retransmit.dev package wraps the API with typed methods and { data, error } results. It has zero dependencies and runs on Node 18+ and edge runtimes.

npm install retransmit.dev

Every example also shows the curl equivalent. The API works from any language.

Send an email

Email needs a verified sending domain. Add it in the dashboard and publish the DNS records it gives you. See Domains.

Sending from an unregistered domain returns 403 domain_not_found. Sending from an unverified one returns 403 domain_not_verified.

import { Retransmit } from "retransmit.dev"; const retransmit = new Retransmit(process.env.RETRANSMIT_API_KEY); const { data, error } = await retransmit.emails.send({ from: "Acme <hello@yourdomain.com>", to: "user@example.com", subject: "Welcome!", html: "<h1>Welcome!</h1>", }); if (error) console.error(error.code, error.message); else console.log(data.id); // em_xxxxxxxxxxxx

The response is 202 Accepted. The email is queued and a worker sends it moments later:

{ "id": "em_xxxxxxxxxxxx", "status": "queued", "created_at": "2026-09-01T12:00:00.000Z" }

For thousands of emails, use Send Batch (retransmit.batch.send([...]) in the SDK). It takes up to 10,000 per request.

Send an SMS

To have your own name on the handset, request a sender ID in the dashboard under SMS > Sender IDs first. It asks for the name and the countries you send to; only countries whose carriers require a registration ask for more. Sending with a name that is not approved returns 422 sender_not_allowed. Leave from out and the message goes under the route’s default sender.

Recipients use international E.164 format with the leading + and country code. All recipients in one request must be in the same country.

const { data, error } = await retransmit.sms.send({ from: "Acme", to: "+237670000000", text: "Your verification code is 482913", }); if (error) console.error(error.code, error.message); else console.log(data.id, data.segments); // sms_xxxxxxxxxxxx 1

See SMS for sender IDs, routing, segments, and statuses.

Send a WhatsApp message

Connect your WhatsApp Business number under WhatsApp in the dashboard. A conversation must start with an approved template. Once the recipient replies, you can send free-form text for 24 hours.

const { data, error } = await retransmit.whatsapp.send({ to: "+237670000000", type: "template", template: { name: "verification_code", language: "en_US", components: [{ type: "body", parameters: [{ type: "text", text: "482913" }] }], }, }); if (error) console.error(error.code, error.message); else console.log(data.id); // wa_xxxxxxxxxxxx

See WhatsApp for templates, media, and replies.

Check delivery status

Every send returns an id. Fetch it any time for the status and event history:

const { data } = await retransmit.emails.get("em_xxxxxxxxxxxx"); console.log(data?.status); // "delivered" const { data: sms } = await retransmit.sms.get("sms_xxxxxxxxxxxx"); console.log(sms?.status); // "delivered" const { data: wa } = await retransmit.whatsapp.get("wa_xxxxxxxxxxxx"); console.log(wa?.status); // "read"

For push updates and WhatsApp replies, set up Webhooks.

Last updated on