Importing email history
Usemailboxes.imports to create an import job, upload the archive directly, start processing, and wait for completion. Set original_addresses to addresses you used at the old provider so sent mail is classified as outbound. Imports are marked read by default.
wait returns completed, failed, or cancelled jobs; a local timeout does not cancel processing. To stop an active job, call cancel or run inkbox mailbox imports cancel <email> <job-id>. Track the independent messages_imported, messages_skipped_duplicate, messages_failed, and messages_rejected_unsafe counters rather than calculating a percentage. Unsafe messages are rejected while the rest of the import continues when possible.
See Mail imports for polling, limits, job fields, and all endpoints.
Drafting email
Save incomplete email in the Inkbox Console or through REST, reopen it from the same inbox, and send only the revision you reviewed. Drafts autosave in the Console, count toward inbox storage, and stay outside ordinary message, thread, and search results until sent. Connected mail apps share the same Drafts folder. Every API mutation carries a generation so concurrent edits are detected rather than silently overwritten. A send rejected before delivery is attempted leaves the draft editable. If delivery cannot be confirmed, the draft becomes read-only and must be duplicated or deleted instead of retried automatically. See Email drafts for Console, REST, conflict, storage, and mail-app workflows, or the Drafts REST reference for every endpoint and field.Custom email signatures
Give each mailbox its own plain-text or HTML signature on a paid plan. Inkbox adds it automatically to outgoing messages, replies, forwards, and draft sends, including mail sent over SMTP. The signature toggle is separate from the organization’s Sent via Inkbox footer setting. See Custom email signatures to configure a signature in the Console, SDK, CLI, or API.Sending email
The simplest case is a plain-text or HTML email to one or more recipients.Branding footer
Outgoing emails include a short “Sent via Inkbox” footer by default. Organizations on a paid plan can remove it: use the “Email footer” setting on the Inkbox Console Email page, or setremove_branding_footer to true with PUT /api/v1/billing/settings
using an admin API key. On the Free plan the footer always applies, and the
request returns 403.
Threaded replies
When your agent needs to continue a conversation, passin_reply_to_message_id with the RFC 5322 message_id of the message you’re replying to. Inkbox links the reply to the existing thread, so the recipient sees one continuous conversation rather than a new email.
Attachments
Pass attachments to the SDK as base64-encoded content with a filename and MIME type. The CLI reads files directly with repeatable--attach flags.
For an inline image, set its content_id in Python or contentId in TypeScript and reference it from the HTML body as cid:chart1. The CLI uses --inline-image chart1=chart.png with --body-html.
Forwarding
Forward an email you’ve already received (or sent) to someone else. Forwards start a brand-new thread — the recipient sees a fresh conversation, not a continuation of the original. Passmode="wrapped" when you need to preserve fidelity (inline images, calendar invites, complex multipart); the default "inline" renders a Gmail-style preamble with the original body below.
send_email.
Reply to everyone
Reply to every visible participant on a message in one call. Inkbox resolves the recipients from the original server-side — the original sender (or itsReply-To) goes in To, the remaining To/Cc recipients go in Cc, and your own mailbox and any BCC recipients are dropped. The reply stays in the original thread, and the subject defaults to "Re: " + original.subject.
send_email.
Tracking opens
Passtrack_opens when sending or forwarding to embed an invisible pixel in the HTML body. The message then reports first_opened_at (the reliable signal) and open_count (an approximate figure — image proxies inflate it and rapid repeat opens deflate it). It needs an HTML body, and the pixel can nudge spam scores.
Reading the inbox
iter_emails() pages through the identity’s entire inbox. Use it in an agent processing loop to handle new messages as they arrive.
iter_unread_emails() and mark messages as read once processed so you don’t handle them twice.
Threads
Every email exchange is grouped into a thread. Useget_thread() to load all messages in a thread at once — for example, to give your LLM full conversation context before generating a reply.
Filtering inbound mail
Control incoming and outgoing mail with a mode,whitelist or blacklist, and a list of contact rules. Both belong to the agent identity, addressed by agent_handle.
Each identity has a mail_filter_mode field with two values:
blacklist(default). Incoming and outgoing mail is permitted unless ablockentry matches the address or domain.whitelist. Incoming and outgoing mail is permitted only when anallowentry matches the address or domain.
exact_email (e.g. jane@acme.example) or domain (e.g. acme.example). Each rule has an action: allow or block. When both match, the exact-address rule takes precedence over the domain rule. The following write examples require an admin API key. You can also manage rules in the Inkbox Console; agent keys cannot create, update, or delete rules.
Most agents start in blacklist mode: accept everyone, add explicit blocks for spam domains or individual bad actors. Switch to whitelist when you want the opposite — locked down by default, with a known allowlist.
Inspecting mailboxes
Most mail operations go through the identity, but sometimes you need the mailbox resource itself — for example, to search across all its messages. For that, useinkbox.mailboxes. Mailboxes are created and destroyed through the identity surface, and filter mode now lives on the identity as mail_filter_mode; this resource is for reading and search. Webhook delivery is configured separately — see the Webhooks guide.

