Quickstart
From zero to your first delivered email. All you need is an account (on the EU cloud or your own instance) and one API credential.
1. Create an API credential
Sign in to the dashboard and create a mail server inside your organization (Organization → Servers → New). Then add a sending domain and an API credential under Server → Credentials. The key is shown exactly once, so store it as CAMELMAILER_KEY in your secret manager.
X-Server-API-Key header. One credential per application environment is a good habit, since you can revoke them independently.2. Send a message
curl -X POST https://mail.yourdomain.com/api/v2/server/messages \ -H "X-Server-API-Key: $CAMELMAILER_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": {"email": "billing@yourdomain.com", "name": "Acme Billing" }, "to": ["customer@example.com"], "subject": "Your receipt", "text_body": "Thanks! You paid €49.00.", "html_body": "<p>Thanks! You paid <strong>€49.00</strong>.</p>", "tag": "receipt" }'
On the cloud, replace mail.yourdomain.com with your instance hostname from the dashboard. The from domain must be a verified sending domain of the server (verify a domain).
await camelmailer.emails.send({ from, to, subject, html_body }). That is one line, with stable error codes and support for a self-hosted base URL.3. Read the response
{
"status": "success",
"time": 0.004,
"data": { "messages": { "customer@example.com": {"id": 1042, "token": "wYcpYAtIiG7R" } } }
}- One message is queued per recipient; each gets an id and token for later lookups.
- On failure the envelope carries
{ "status": "error", "error": { code, message } }; branch onerror.coderather than the message text.
4. Use a stored template instead
The template library ships 20 production-ready transactional templates. Import them once, then send with a template_model:
curl -X POST https://mail.yourdomain.com/api/v2/server/messages/with_template \ -H "X-Server-API-Key: $CAMELMAILER_KEY" -H "Content-Type: application/json" \ -d '{ "from": "hello@yourdomain.com", "to": ["ada@example.com"], "template": "welcome", "template_model": {"name": "Ada", "product": "Acme", "action_url": "https://app.acme.com/start" } }'
5. Watch it happen
# everything you sent GET /api/v2/server/messages?scope=outgoing&per_page=50 # one message + its delivery attempts GET /api/v2/server/messages/1042 GET /api/v2/server/messages/1042/deliveries # counters for your dashboard GET /api/v2/server/stats
Prefer push over polling? Set up webhooks and get signed events for deliveries, bounces, opens and clicks.
Next steps
- Grab an official SDK for Node.js, Python, PHP, Laravel, Go, Ruby, Rust, Java or .NET
- Send with Node.js or Python
- Set up SPF, DKIM and DMARC for reliable inbox placement
- Self-host the whole platform
