Getting started
Quickstart
From zero to your first send in three steps — SDK, CLI, or raw HTTP.
rootmail is one email platform with four front doors: the web dashboard, the typed Node SDK, the CLI, and the REST API. Everything the dashboard does is available in code, and everything you build in code stays editable in the dashboard. This guide sends your first email in three steps.
1. Get an API key
Create a key in the dashboard under Developers → API keys. Keys are scoped to a single workspace and environment — rm_live_… keys send real mail, rm_test_… keys run in the sandbox (never delivered, never billed). A key's secret is shown once, so store it somewhere safe.
2. Install the SDK
The official Node SDK is the fastest path. Any HTTP client works too — see the REST tab below.
pnpm add @rootmail/node3. Send your first email
import { RootMail } from "@rootmail/node";
const mail = new RootMail({ apiKey: process.env.ROOTMAIL_API_KEY! });
await mail.messages.create({
to: "ada@example.com",
subject: "Welcome aboard",
html: "<h1>You're in 🎉</h1><p>Thanks for signing up.</p>",
});The same call over raw HTTP:
curl https://service.gateml.io/v1/messages \
-H "Authorization: Bearer $ROOTMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "ada@example.com",
"subject": "Welcome aboard",
"html": "<h1>You'\''re in 🎉</h1>"
}'Or from the terminal with the CLI:
npm i -g @rootmail/cli
export ROOTMAIL_API_KEY=rm_live_…
rootmail send --to ada@example.com --subject "Welcome aboard" --html "<h1>You're in</h1>"What next
- Authentication — keys, environments, and scoping.
- Send a template — author reusable templates, send by slug with variables.
- Webhooks — get delivery, open, click, bounce, and inbound-reply events.
- Idempotency — make retries safe so you never double-send.