Email Infrastructure for Superblocks AI Workflows

MultiMail provides the email backend your Superblocks automations need — with delivery policy enforcement, approval queues, and audit trails built in.


Superblocks lets engineering teams build internal tools, approval dashboards, and operational automations on top of their existing data sources. When those automations need to send, receive, or route email — especially email triggered by AI agents — you need a backend that enforces delivery policy, not just one that calls an SMTP relay.

MultiMail exposes a REST API designed for programmatic agents. Every call to `send_email`, `reply_email`, or `decide_email` is subject to the oversight mode you configure per mailbox. In a Superblocks workflow, that means you can gate agent-drafted emails through a human approval step before delivery, or run fully autonomously once you've validated the agent's behavior.

The typical pattern is a Superblocks workflow that invokes MultiMail's REST API via its built-in HTTP integration. The workflow handles the business logic — routing, escalation, record updates — while MultiMail handles the email primitives and enforces the delivery contract.

Built for Superblocks developers

Approval-aware email primitives

MultiMail's `gated_send` and `gated_all` oversight modes hold outbound email in a pending queue until a human approves via `decide_email`. Your Superblocks approval UI can drive that decision without needing to rebuild delivery gating logic.

Webhook-driven inbound routing

Inbound email to any `@multimail.dev` or custom-domain mailbox fires a webhook your Superblocks workflow can consume. Route support tickets, parse structured replies, or trigger downstream automations based on email content — without polling.

Audit trail for every agent action

Every `send_email`, `reply_email`, and `decide_email` call is logged with the mailbox, agent identity, and approval status. Enterprises subject to SOC 2 or internal change-management policies get a full record without extra instrumentation.

Mailbox isolation per workflow or tenant

Use `create_mailbox` to provision a dedicated mailbox per Superblocks application, customer segment, or environment. Inbound and outbound traffic stays isolated, and quota limits are enforced at the mailbox level.

Formally verified security model

MultiMail's oversight, identity, and authorization logic is verified in Lean 4. For enterprise workflows handling sensitive operational email, that means the delivery gating behavior is provably correct — not just tested.


Get started in minutes

Send an agent-drafted email from a Superblocks workflow
typescript
"cm">// Superblocks API step — JavaScript (Fetch)
const response = await fetch('https://api.multimail.dev/send_email', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + Env.MULTIMAIL_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from: '[email protected]',
    to: ['[email protected]'],
    subject: 'PO #{{purchase_order_id}} — approval required',
    body: {
      text: `Hi,\n\nWe are ready to approve purchase order #${inputs.purchase_order_id}.\nAmount: $${inputs.amount}\n\nPlease confirm receipt.`,
    },
    oversight_mode: 'gated_send',
    metadata: {
      workflow_run_id: inputs.run_id,
      initiated_by: 'procurement-automation',
    },
  }),
});

const result = await response.json();
"cm">// result.message_id — use this to poll or decide
return result;

Call MultiMail's `send_email` endpoint from a Superblocks API step. Using `gated_send` oversight mode, the email is held for human approval before delivery.

Approve or reject a pending email from the Superblocks approval UI
typescript
"cm">// Superblocks button onClick handler
const decision = await fetch('https://api.multimail.dev/decide_email', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + Env.MULTIMAIL_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    message_id: table1.selectedRow.data.message_id,
    decision: 'approve', "cm">// or 'reject'
    reviewer_note: textInput1.value || undefined,
  }),
});

const result = await decision.json();
if (result.status === 'sent') {
  showNotification({ message: 'Email delivered.', type: 'success' });
} else {
  showNotification({ message: 'Rejected and cancelled.', type: 'info' });
}
await pendingEmailsQuery.trigger(); "cm">// refresh the queue table

After an agent queues an email with `gated_send`, a Superblocks button component can call `decide_email` to approve or reject delivery without leaving the internal tool.

Check a mailbox inbox and surface items in a Superblocks table
typescript
"cm">// Superblocks Query — runs on page load
const response = await fetch(
  'https:"cm">//api.multimail.dev/[email protected]&unread=true&limit=50',
  {
    headers: {
      'Authorization': 'Bearer ' + Env.MULTIMAIL_API_KEY,
    },
  }
);

const { emails } = await response.json();

"cm">// Return shaped for a Superblocks table
return emails.map(e => ({
  id: e.message_id,
  from: e.from,
  subject: e.subject,
  received_at: new Date(e.received_at).toLocaleString(),
  has_attachment: e.attachments?.length > 0,
}));

Pull unread emails from a MultiMail mailbox to populate a Superblocks table widget. Use this as the data source for a triage or escalation dashboard.

Provision a dedicated mailbox when onboarding a new tenant
typescript
"cm">// Superblocks workflow step — create mailbox on tenant creation
const response = await fetch('https://api.multimail.dev/create_mailbox', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + Env.MULTIMAIL_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: `tenant-${inputs.tenant_slug}`,
    domain: 'multimail.dev',
    oversight_mode: 'gated_send',
    webhook_url: `https:"cm">//superblocks.acme.com/api/webhooks/email?tenant=${inputs.tenant_id}`,
  }),
});

const mailbox = await response.json();
"cm">// mailbox.address => "[email protected]"
await db.updateTenant({ id: inputs.tenant_id, email_address: mailbox.address });
return mailbox;

Call `create_mailbox` from a Superblocks onboarding workflow to give each customer a dedicated email address automatically.

List pending emails and cancel a queued send
typescript
"cm">// Superblocks Query — fetch the pending queue
const listRes = await fetch(
  'https://api.multimail.dev/[email protected]',
  { headers: { 'Authorization': 'Bearer ' + Env.MULTIMAIL_API_KEY } }
);
const { pending } = await listRes.json();

"cm">// Superblocks button — cancel a selected item
async function cancelSelected() {
  const cancelRes = await fetch('https://api.multimail.dev/cancel_message', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ' + Env.MULTIMAIL_API_KEY,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ message_id: pendingTable.selectedRow.data.id }),
  });
  const result = await cancelRes.json();
  await pendingQuery.trigger();
  return result;
}

Use `list_pending` and `cancel_message` together to give Superblocks operators a pre-send review queue with the ability to pull back any queued email.


Step by step

1

Create a MultiMail account and generate an API key

Sign up at multimail.dev, choose a plan (Starter is free), and generate a live API key from the dashboard. Copy the `mm_live_...` key — you will store it as a Superblocks environment variable.

bash
"cm"># Verify the key works
curl -s https://api.multimail.dev/check_inbox \
  -H "Authorization: Bearer $MULTIMAIL_API_KEY" \
  -G --data-urlencode "[email protected]"
2

Store the API key in Superblocks environment variables

In your Superblocks organization settings, add `MULTIMAIL_API_KEY` as a secret environment variable. Reference it in API steps as `Env.MULTIMAIL_API_KEY`. Never hardcode the key in a workflow definition.

3

Provision a mailbox for your workflow

Call `create_mailbox` once to provision the address your workflow will send from and receive at. Set `oversight_mode` to `gated_send` while you validate behavior, then switch to `monitored` or `autonomous` once you're confident.

bash
curl -s -X POST https://api.multimail.dev/create_mailbox \
  -H "Authorization: Bearer $MULTIMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d &"cm">#039;{"name":"ops-agent","domain":"multimail.dev","oversight_mode":"gated_send"}'
4

Add an HTTP API step to your Superblocks workflow

In the Superblocks workflow editor, add a REST API step pointing to `https://api.multimail.dev/send_email`. Set the Authorization header to `Bearer {{Env.MULTIMAIL_API_KEY}}` and build the request body from your workflow's input variables.

5

Build the approval dashboard (optional for gated_send)

If you are using `gated_send`, create a Superblocks app with a table bound to a `list_pending` query and Approve / Reject buttons that call `decide_email`. This is your human-in-the-loop review interface for agent-drafted email.


Common questions

Does MultiMail work with Superblocks' native REST API integration?
Yes. MultiMail's API follows standard REST conventions with JSON request and response bodies. Any Superblocks API step that can set an Authorization header and POST JSON can call MultiMail endpoints. No custom connector is required.
Can I trigger a Superblocks workflow when an email arrives?
Yes. When creating a mailbox, set the `webhook_url` field to a Superblocks webhook endpoint. MultiMail will POST inbound email payloads to that URL, including sender, subject, body, and any extracted metadata. Superblocks can then fan out to database writes, API calls, or notifications.
How do I gate agent emails so a human reviews them before delivery?
Create the mailbox with `oversight_mode: 'gated_send'`. Any `send_email` call from that mailbox will be held in the pending queue rather than delivered. Build a Superblocks table that queries `list_pending` and add buttons that call `decide_email` with `decision: 'approve'` or `decision: 'reject'`.
What happens if a Superblocks workflow fails after calling send_email?
If the mailbox is in `gated_send` mode, the message stays in the pending queue and will not deliver until explicitly approved via `decide_email`. If it is in `autonomous` mode and the call returned a 200, the email has already been queued for delivery. Use `cancel_message` within the same workflow to retract it if a subsequent step fails.
Can I use MultiMail with Superblocks' approval flow feature?
Yes, and this is a natural pairing. A Superblocks approval step can gate the Superblocks-side workflow, while MultiMail's `gated_send` mode gates the email delivery itself. You can use both independently or chain them — for example, require a Superblocks approval before the workflow even calls `send_email`, and then use MultiMail's approval as a second confirmation step.
Does MultiMail support custom domains for Superblocks enterprise deployments?
Yes. You can provision mailboxes on your own domain (e.g., `[email protected]`) by adding MultiMail's MX records to your DNS configuration. Custom domain mailboxes behave identically to `@multimail.dev` addresses and support the same oversight modes and webhook configurations.
Is there a Superblocks-specific SDK or plugin?
No dedicated plugin is needed. Superblocks' built-in HTTP integration handles all MultiMail API calls. If you prefer a typed client, MultiMail's Python SDK (`multimail-sdk`) can run in a Superblocks Python step, though the REST API is sufficient for most workflow patterns.

Explore more

The only agent email with a verifiable sender

Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 38-tool MCP server. Formally verified in Lean 4.