Quickstart
1. Get your API key
Section titled “1. Get your API key”In the dashboard, create an API key. Store it securely: the token is only shown once when you create it.
2. Verify your domain
Section titled “2. Verify your domain”To send signed email you need a verified domain. Publish the SPF/DKIM/DMARC records provided by the API (see Concepts).
3. Send an email
Section titled “3. Send an email”The payload follows SendGrid style: personalizations[].to[].email, from, subject
and content[].
curl -X POST https://api.mailerdash.com/v1/mail/send \ -H "Authorization: Bearer $MAILERDASH_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Md-Channel: trans" \ -d '{ "personalizations": [{ "to": [{ "email": "recipient@example.com" }] }], "from": { "email": "no-reply@tu-dominio.com", "name": "Tu Servicio" }, "subject": "Hola desde MailerDash", "content": [{ "type": "text/html", "value": "<h1>Funciona 🎉</h1>" }] }'const res = await fetch('https://api.mailerdash.com/v1/mail/send', { method: 'POST', headers: { Authorization: `Bearer ${process.env.MAILERDASH_API_KEY}`, 'Content-Type': 'application/json', 'X-Md-Channel': 'trans', }, body: JSON.stringify({ personalizations: [{ to: [{ email: 'recipient@example.com' }] }], from: { email: 'no-reply@tu-dominio.com', name: 'Tu Servicio' }, subject: 'Hola desde MailerDash', content: [{ type: 'text/html', value: '<h1>Funciona 🎉</h1>' }], }),});console.log(res.status, await res.json());import os, requests
res = requests.post( "https://api.mailerdash.com/v1/mail/send", headers={ "Authorization": f"Bearer {os.environ['MAILERDASH_API_KEY']}", "X-Md-Channel": "trans", }, json={ "personalizations": [{"to": [{"email": "recipient@example.com"}]}], "from": {"email": "no-reply@tu-dominio.com", "name": "Tu Servicio"}, "subject": "Hola desde MailerDash", "content": [{"type": "text/html", "value": "<h1>Funciona 🎉</h1>"}], },)print(res.status_code, res.json())Errors
Section titled “Errors”Error responses use a consistent format:
{ "error": { "type": "validation_error", "code": "domain_unauthorized", "message": "..." } }See the error reference for the full catalog of type and
code values.