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.
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 own email provider (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. The self-test mailbox that proves a sending route end to end is available as part of the domain setup flow, so a provisioning script can confirm a route works before your product relies on it. Pair it with a real send to your own mailbox 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 your own mailbox to check authentication. All of this is scriptable through the API.
Related Guides
- Sending Domains and DNS Verification: the domain flow the API and MCP tools drive.
- Outbound Routing and Allowances: routing choices and connecting your own provider.
- REST API Reference: the full endpoint documentation.
- MCP and Agent Integration: connect an AI agent to your workspace.