Skip to Content
MailroomMailroom home

Sending email

POST /emails — fields, streams, scheduling, attachments, and status.

Early access

Live sending works from your workspace's managed address once you claim the workspace, or from your own domain after you publish one DKIM record. Attachments and templates are not built yet.

POST /v1/emails authenticates, rate-limits, validates, checks Idempotency-Key, runs the policy engine when an agent is attached, drops suppressed recipients, persists the row, and enqueues send in one transaction. It returns 202 with id and status.

Request

await mailroom.emails.send({
  from: 'billing@acme.dev',
  to: ['ada@example.com'],
  cc: ['finance@acme.dev'],
  reply_to: 'support@acme.dev',
  subject: 'Invoice 1842',
  html: '<p>Thanks for being a customer.</p>',
  text: 'Thanks for being a customer.',
  tags: [{ name: 'category', value: 'invoice' }],
  metadata: { invoice_id: '1842' },
  stream: 'transactional', // transactional | broadcast | agent
});
FieldNotes
fromDomain must be verified for the org, or the org's managed subdomain.
to / cc / bccRecipients. Batch is a separate endpoint (max 100).
html / textAt least one required unless template_id is set.
template_id + variablesHandlebars-style {{var}}. Or send pre-rendered React Email HTML.
attachments{ filename, content_base64 | url }. Size-capped.
scheduled_atUp to 72h in the future.
agent_idRuns the policy engine. Implied by an agent-scoped key.
thread_idReply in an existing thread.
streambroadcast requires RFC 8058 List-Unsubscribe headers we add for you.

Open/click tracking is off by default, opt-in per domain.

Statuses

queued · pending_approval · scheduled · sending · sent · delivered · bounced · complained · failed · suppressed · rejected · cancelled

Cancel with POST /emails/{id}/cancel while queued, scheduled, or pending_approval.

SMTP relay

Port 587 STARTTLS or 465 TLS, authenticated by API key, same pipeline as HTTP. Intended for apps that already speak SMTP.

What we add

  • Message-ID: <id@domain>
  • Provenance headers when an agent is attached (signed identity)
  • List-Unsubscribe + List-Unsubscribe-Post on broadcast
  • Suppression check on every recipient

On this page