Tooling
Node SDK
@rootmail/node — the whole API, fully typed, one import.
The official Node client wraps every endpoint with end-to-end TypeScript types, maps snake_case JSON to camelCase, normalizes errors into one RootMailError, and adds sub-tenant scoping.
terminal
pnpm add @rootmail/nodeinit.ts
import { RootMail } from "@rootmail/node";
const mail = new RootMail({
apiKey: process.env.ROOTMAIL_API_KEY!,
// baseUrl defaults to https://service.gateml.io
});Resources
Each API area is a resource on the client:
mail.messagesresource | create, get, list, audit, proof, recordEvent |
mail.templatesresource | create, get, list, update, remove |
mail.contactsresource | create, get, unsubscribe |
mail.listsresource | audiences + membership |
mail.campaignsresource | create, send, analytics |
mail.sequencesresource | create, enroll, enrollments, analytics |
mail.threadsresource | list, get, reply |
mail.subTenantsresource | client domains + verify |
mail.webhooksresource | endpoints + deliveries |
mail.deliverability / mail.analyticsresource | reputation + the funnel |
mail.suppressions / mail.importsresource | do-not-send list + migration |
mail.compliance / mail.retentionresource | proof + retention |
mail.assistantresource | the AI agent |
Sub-tenant scoping
scoped.ts
const scoped = mail.withSubTenant("tnt_123");
await scoped.messages.create({ to, subject, html }); // sends as that clienttipSet
idempotencyKey on any create call to make it safe to retry.