SLSmartletter API

Sending email

Transactional email with the smartletter SDK (or the Resend SDK): batches, scheduling, attachments.

The /emails endpoints follow Resend's API. The smartletter package is the official SDK: same method names as Resend (emails.send, batch.send, emails.get, emails.list, emails.update and emails.cancel), same { data, error } answer. The from domain must be verified in your workspace.

// npm i smartletter
import { Smartletter } from "smartletter";

const sl = new Smartletter(process.env.SMARTLETTER_API_KEY);

const { data, error } = await sl.emails.send({
  from: "Acme <[email protected]>",
  to: ["[email protected]"],
  subject: "Welcome",
  html: "<p>Hi Jane</p>",
});

Already using the Resend SDK?

Keep your code: point the official Resend SDK at https://api.smartletter.ai with a Smartletter key.

import { Resend } from "resend";

// The official Resend SDK, pointed at Smartletter.
const resend = new Resend(process.env.SMARTLETTER_API_KEY, { baseUrl: "https://api.smartletter.ai" });

const { data, error } = await resend.emails.send({
  from: "Acme <[email protected]>",
  to: ["[email protected]"],
  subject: "Welcome",
  html: "<p>Hi Jane</p>",
});

Batches

  • Up to 100 emails per POST /emails/batch call, each with up to 50 recipients. The answer lists the ids in the order of the request.
  • One Idempotency-Key covers the whole batch, and the monthly quota is checked for the whole batch before anything is sent.
  • The first 20 recipients leave during the call. The rest leaves within a minute, paced so a batch never bursts past the sending rate. A temporary Amazon SES error is retried for you instead of failing.
  • x-batch-validation: strict (default) refuses the whole batch when one email is invalid; permissive sends the valid ones and lists the others in errors (index, message). With the SDK: sl.batch.send(emails, { batchValidation: "permissive" }).
  • Attachments are not accepted in batches (as with Resend): send those emails one by one.

Scheduling

  • scheduled_at takes an ISO 8601 date (2026-10-20T09:00:00Z) or English like in 1 hour, tomorrow at 9am, Friday at 3pm ET (UTC when no time zone is given), up to 30 days ahead.
  • The email goes out within a minute of that time. Until then last_event is scheduled; move it with PATCH /emails/{id} or cancel it for good with POST /emails/{id}/cancel.
  • When it leaves, everything is checked again: verified domain, suppression list and monthly quota. A scheduled email counts in the month it is sent.
  • Webhooks: email.scheduled when you schedule it, then the usual events once it is sent.

Topics

  • With topic_id, only the recipients eligible to that topic receive the email. The others are kept as suppressed (reason: topic_unsubscribed).
  • With an opt_in topic, an address that is not a contact of the topic's segment is suppressed too. With a default_on topic, an address that is no contact still receives it.
  • A scheduled email is checked again when it really goes out: someone who left the topic meanwhile gets nothing. If the topic was archived meanwhile, nothing is sent.

Attachments

  • Each file has content (base64; a Node Buffer works with the SDK) or path (an https URL we download, 10 seconds max, private addresses refused; up to 5 redirects are followed, each target held to the same rules). A file served as application/octet-stream takes its type from its file name, unless you set content_type.
  • filename is required with content; content_type comes from the file name when absent.
  • content_id makes the file an inline image: write <img src="cid:logo"> in your html.
  • Up to 20 files and 10 MB in total per email (Resend allows 40 MB).
  • Executable types are refused, as Amazon SES does: .ade, .adp, .app, .asp, .bas, .bat, .cer, .chm, .cmd, .com, .cpl, .crt…
  • Files of a scheduled email are kept in private storage until it is sent or canceled, then deleted. They cannot be downloaded back.

Differences with Resend

  • Not available yet: GET /emails/{id}/attachments.
  • GET /emails/{id} adds status, recipients (each recipient's status, with the SMTP diagnostic of a bounce or a delay) and attachments (name, type, size).
  • Opens and clicks are not tracked on transactional emails.