API and AI Agents

Everything you can do with Backbuild Mail in the app, you can also do from code. The whole mailbox and domain surface is available over the public REST API, and mailbox and domain provisioning is exposed as native tools your AI agents can call over MCP. This guide teaches you what is drivable programmatically and how to verify a route from a script. After this page you will be able to provision and manage mail without touching the UI.

The REST API

After this section you will know the mailbox surface is fully scriptable. The entire Backbuild platform is drivable over the public REST API, and Backbuild Mail is no exception. Mailboxes, messages, labels, filters, attachments, domains, and settings are all reachable, so you can build the mail parts of your product or automate your own mailbox operations.

  • Authenticated and organization-scoped: every call is authenticated and scoped to your organization, and gated by the same permissions as the app, so a script can never reach beyond what its identity is allowed.
  • The full surface: create and manage mailboxes, send and read messages, manage labels and filters, upload and fetch attachments, and link and verify domains.
  • The same picture as the app: the mailbox list marks your own inbox, says which mailboxes you own and which you can write to, and names the virtual worker a mailbox belongs to when you can see that worker. The domain list says whether each domain's ownership is verified, which is what allows mailboxes to be created on it.

For endpoints, request and response shapes, and authentication, see the REST API reference and API authentication.

MCP Tools for AI Agents

After this section your AI agents will be able to provision mail. Backbuild Mail exposes native tools on the platform MCP surface, so an AI agent connected to your workspace can set up and manage mail as part of a larger task. The tools cover mailbox and domain provisioning:

  • Mailboxes: create a mailbox and list mailboxes.
  • Domains: add a domain, get and list domains, verify ownership, verify DNS, and provision routing and authentication records.

This lets an agent stand up a working mailbox at a verified domain end to end. How to connect an agent over MCP is covered in MCP and Agent Integration and the MCP server reference.

Is there an API or MCP surface to create mailboxes and domains programmatically? Yes. The whole mailbox and domain surface is available over the REST API, and mailbox and domain provisioning is available as native MCP tools an AI agent can call: create and list mailboxes, and add, verify, and provision domains.

Provider Keys Stay in the Vault

After this section you will know your provider credentials are handled safely from code too. When you connect your organization's Resend account (see Outbound Routing and Allowances), its key is stored and resolved through the workspace vault. It is never returned in an API response and never written to a log, whether you connect it in the app or through the API.

Test a Route From a Script

After this section you will be able to verify sending in an automated check. A provisioning script can create a self-test mailbox on the domain through the API, send a message from it along the route, and confirm the message arrives, so it knows the route works before your product relies on it. The self-test is sent as system mail, so it travels through Resend when the domain routes system mail or all outbound mail there. Pair it with a send to an address outside Backbuild to confirm authentication passes.

How do I confirm a sending route works before shipping? Provision the domain, use the self-test mailbox to send along the route and confirm delivery, and send a message to an address outside Backbuild to check authentication. All of this is scriptable through the API.

Related Guides