Developers

One API key for every email provider

Send through Resend, Amazon SES, Brevo, Mailgun, Postmark, SendGrid, Cloudflare and any SMTP server with one endpoint and one SMTP host. Routing, quotas and failover happen in OneSend, on your own server, so your code stays the same when providers change.

Send

Send a template with variables

Send the template name and its variables. The template is rendered once, so every provider and every failover attempt sends the same finished HTML.

  • REST API with an OpenAPI reference
  • SDKs for TypeScript (@onesend/sdk), Python, Go and PHP, and a CLI (onesend)
  • SMTP submission for apps and tools that only speak SMTP
  • Idempotency keys, so retries never send twice
  • Batch sends, scheduling and per-message tags
Terminal
curl -X POST https://your-server.example/v1/emails \
  -H "Authorization: Bearer $ONESEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "hello@acme.dev",
    "to": "ada@example.org",
    "template": "welcome-email",
    "variables": { "first_name": "Ada", "plan": "Pro" }
  }'
send.ts
import { OneSend } from '@onesend/sdk';

const client = new OneSend({
  apiKey: process.env.ONESEND_API_KEY,
  baseUrl: 'https://your-server.example', // your server
});

// The template is rendered once, so every provider and every
// failover attempt sends the same finished HTML.
await client.emails.send(
  {
    from: 'hello@acme.dev',
    to: 'ada@example.org',
    template: 'welcome-email',
    variables: { first_name: 'Ada', plan: 'Pro' },
  },
  { idempotencyKey: 'signup-4821' },
);

Observe

Every attempt, with the provider's own answer

Each message shows which provider tried, what it answered and how long it took. Delivery, bounce, open and click events arrive on signed webhooks.

Webhooks
One email in the log: the first provider ran out of daily quota, and the second provider delivered the message.One email in the log: the first provider ran out of daily quota, and the second provider delivered the message.

Everything is an API

Every feature in the dashboard is also in the API, and AI agents get the same tools through the MCP server.

MCP for AI agents

Let an agent send email, use templates and read the logs, with an API key whose scope and limits you set.

MCP server

Routing as configuration

Priority, weight or round robin, daily caps per provider, and rules by message type, tag or recipient domain.

Routing concepts

Compatible endpoints

Keep your existing Resend, SendGrid or Postmark code. Change the base URL and the key.

Migration guides

Python and MCP

The same call from Python, and an MCP client configuration for a self-hosted server.

Set up MCP
send.py
from onesend import OneSend

client = OneSend()  # reads ONESEND_API_KEY and ONESEND_BASE_URL
client.emails.send(
    {"from": "hello@acme.dev", "to": "ada@example.org",
     "template": "welcome-email", "variables": {"first_name": "Ada"}},
    idempotency_key="signup-4821",
)
mcp.json
{
  "mcpServers": {
    "onesend": {
      "command": "node",
      "args": ["/path/to/onesend/apps/mcp/bin/onesend-mcp.mjs"],
      "env": {
        "ONESEND_API_KEY": "os_test_...",
        "ONESEND_BASE_URL": "https://your-server.example"
      }
    }
  }
}

Developer questions

What if my OneSend server is unreachable?

The TypeScript and Python SDKs retry rate limits, server errors and network errors twice by default, with backoff and the same Idempotency-Key, so a retry never sends twice. They do not fall back to sending through a provider directly, so plan for it as you would for any single provider: queue and retry. Running the server next to your app, on the same Cloudflare account or network, keeps that path short.

How are provider API keys stored?

Encrypted at rest with AES-256-GCM, and never returned by the API or shown again in the dashboard. See Security for how keys are stored, used and rotated.

Can I switch from my current provider without rewriting code?

Yes. There are send endpoints that accept the Resend, SendGrid and Postmark request formats. Change the base URL and the key, and your existing code sends through all your providers. See the migration guides.

Can my app receive email?

Yes, with the self-hosted edition. Point a domain at your installation (MX records, or Cloudflare Email Routing to the Worker) and its mail arrives in your mailboxes; inbound events reach your app through signed webhooks, and agents can read and reply through the API and MCP. Delivery, bounce, open and click events arrive on the same webhooks. See receiving mail.

One key for every provider

Deploy your server, create an API key and send your first email.