Documentation
Quickstart
From zero to a delivered email in three steps: get a key, verify a domain, send.
1. Get an API key
In the dashboard, open Developers → API Keys and create a key. Copy it — it is shown once. Keys start with ms_.
2. Add and verify a sending domain
You can only send from a domain you have verified. Add one under Domains (or via the API), then add the SPF, DKIM and return-path records it shows to your DNS. Full walkthrough: Domains & DNS →
Until a domain is verified, sends from addresses on it are rejected. Verification usually completes within minutes of the DNS records propagating.
3. Send an email
Once your domain is verified, send from any address on it.
cURL
curl -X POST https://app.mailstein.com/api/v1/emails \ -H "Authorization: Bearer ms_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "from": "hello@yourdomain.com", "to": "customer@example.com", "subject": "Welcome aboard", "html": "<h1>You're in.</h1>" }'
Node.js
import { Mailstein } from "mailstein"; const mailstein = new Mailstein("ms_your_api_key"); await mailstein.emails.send({ from: "hello@yourdomain.com", to: "customer@example.com", subject: "Welcome aboard", html: "<h1>You're in.</h1>", });
Python
from mailstein import Mailstein client = Mailstein("ms_your_api_key") email, err = client.emails.send({ "from": "hello@yourdomain.com", "to": "customer@example.com", "subject": "Welcome aboard", "html": "<h1>You're in.</h1>", })
Both SDKs are live:
npm install mailstein and pip install mailstein. See Libraries for the CLI and MCP server too.4. Check the status
The send returns an emailId. Look it up any time, or subscribe to webhooks for delivery, bounce, open and click events.
cURL
curl https://app.mailstein.com/api/v1/emails/em_123 \ -H "Authorization: Bearer ms_your_api_key"