Give Your OpenAI Assistant Safe Email Access

Register MultiMail as a function tool in any Assistant. Reads, sends, and replies route through configurable oversight modes before delivery.


The OpenAI Assistants API manages the orchestration layer for you — threads, run lifecycle, tool dispatch, and file context — so you can focus on what the assistant actually does. When that includes email, you need more than a raw SMTP credential attached to a function.

MultiMail exposes its full surface as JSON-schema function tools that register directly in an Assistant definition. The assistant calls check_inbox, send_email, or reply_email; MultiMail handles authentication, rate limiting, oversight gating, and delivery receipts before anything leaves your infrastructure.

Oversight mode is set per mailbox, not per call. An assistant operating in gated_send mode composes messages freely but every outbound send pauses for human approval via the MultiMail dashboard or webhook. The assistant never needs to know whether a given run required human review — the control plane is invisible to the model.

Because Assistants run server-side with persistent threads, inbound email is handled via webhooks that post to your server and optionally resume a Run with a tool output. MultiMail's inbound webhook delivers a structured payload — sender, subject, body, attachments — ready to pass directly into a thread as a tool result.

Built for OpenAI Assistants API developers

Function schemas that match the Assistants tool format

Define send, list-inbox, read, reply, and tag tools in your Assistant's tools array. A thin dispatcher in your run loop maps each tool call to the matching MultiMail route (the mailbox id goes in the path; the body uses fields like to and markdown), so wiring stays minimal.

Oversight modes enforced outside the model

The Assistants runtime controls when tools are called, but not what happens after. MultiMail's gated_send mode intercepts every outbound message at the API layer regardless of what the model decided, ensuring approvals can't be bypassed by prompt injection or unexpected tool chaining.

Inbound email as first-class tool output

MultiMail webhooks deliver inbound messages as structured JSON. Your server can call submit_tool_outputs to feed the email into an active Run, continuing the thread without polling or background jobs.

Provenance across thread turns

Every email sent or received is logged with the thread ID, run ID, and assistant ID that triggered it. Audit trails map back to the exact conversation state that produced each outbound message.

Isolation between assistants and mailboxes

Each assistant gets its own MultiMail API key scoped to specific mailboxes. A customer-support assistant cannot access the mailboxes provisioned for a billing assistant, even if both run under the same OpenAI organization.


Try it with your agent

No code, no dashboard. Paste this to your AI agent — it connects MultiMail, creates an inbox, and builds the flow for you.

You are my MultiMail email agent. Follow these steps exactly: 1. Get MultiMail ready: read https://multimail.dev/llms.txt, connect the MultiMail MCP server, create a free inbox, and set up a verified sending domain before attempting to send mail. 2. Wire MultiMail into my OpenAI Assistants API Assistant by using the Assistants API function tool mechanism. Register function tools for checking the inbox, drafting replies, and sending email; these functions should call MultiMail through the connected MCP server and configured oversight mode. 3. Use the inbox-check capability to read new messages, the draft-reply capability to prepare responses, and the send capability only when a message is explicitly ready for delivery. Replies, new sends, and scheduled email must all route through MultiMail oversight. 4. Send one test email from the verified sender to the free inbox. Then check the inbox, draft a short reply confirming receipt, and prepare it for review. 5. Run in gated_send mode at all times for this setup. Do not send, reply, or schedule anything until I review and approve the exact message content and recipient.

Step by step

1

Create a MultiMail mailbox

Sign up at multimail.dev and provision a mailbox for your assistant. Set the oversight mode to gated_send to require approval on all outbound messages during development.

2

Define MultiMail function tools in your Assistant

Add send_email and check_inbox to your Assistant's tools list. Use the JSON schemas that match MultiMail's request body format so tool arguments pass through without transformation.

3

Handle requires_action in your run loop

Poll run status and intercept requires_action states. For each tool call, forward arguments to the corresponding MultiMail endpoint and collect the JSON response.

4

Register the inbound webhook

In the MultiMail dashboard, set an inbound webhook URL pointing to your server. MultiMail will POST structured email payloads on new delivery, which you can feed into active threads or use to trigger new runs.

5

Approve or reject sends from the dashboard

With gated_send active, outbound messages appear in the MultiMail approval queue. Review and approve from the dashboard or via the API. Once approved, MultiMail delivers the message and your run continues.


Common questions

Can the Assistant call MultiMail tools without a middleware server?
No. The Assistants API requires your server to handle the requires_action lifecycle — retrieve pending tool calls, execute them, and submit outputs. MultiMail is a REST API your server calls during that step. There is no direct connection between OpenAI's runtime and MultiMail.
Does MultiMail support streaming Runs?
Yes. The tool dispatch logic works identically with streaming Runs. When you receive a thread.run.requires_action event in the stream, call the same submit_tool_outputs endpoint with results from MultiMail. The stream resumes after submission.
What happens if a gated send is rejected?
MultiMail returns status: rejected in the message record. Your server should submit this as the tool output so the Assistant knows the send did not complete. The Assistant can then decide whether to retry, modify the message, or notify the user — the rejection is visible to the model as a tool result.
How are thread IDs linked to email audit logs?
Keep your own mapping from the returned message id (the id field in the send response) to the OpenAI thread and run that produced it. Every send, reply, and oversight decision is recorded in MultiMail's audit log (GET /v1/audit-log), so you can correlate a message id from the log back to the exact conversation turn that caused it.
Can one Assistant use multiple mailboxes?
Yes. Pass mailbox_id as a parameter in every tool call. The Assistant can manage multiple mailboxes — for example, a support mailbox and a billing mailbox — as long as your API key has access to both. Each mailbox has its own oversight mode configuration.
Does this work with the Responses API as well?
Yes. The Responses API uses the same function calling contract as Assistants. The tool schemas, dispatch logic, and MultiMail API calls are identical — only the run lifecycle management differs.

Explore more

The only agent email with a verifiable sender

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