Simplifyd Cloud
SmailAPI ReferenceEmailsSend Email

Send Email

Send a single transactional or marketing email.

POST /api/v1/emails

Sends a single email. The from address must belong to a verified domain on the account. Authenticate with an X-API-Key header.

Request body

FieldTypeRequiredDescription
fromstringYesSender address (must be on a verified domain)
tostring[]YesRecipient addresses
subjectstringYesEmail subject line
htmlstringNoHTML body
textstringNoPlain-text body
ccstring[]NoCarbon copy recipients
bccstring[]NoBlind carbon copy recipients
reply_tostringNoReply-to address
tagsstring[]NoLabels for filtering in the dashboard
typestringNo"transactional" (default) or "marketing"

At least one of html or text is required.

Response

Returns 200 OK with an email object:

FieldTypeDescription
idstringUnique email ID
statusstring"queued", "sent", or "failed"
fromstringSender address
tostringPrimary recipient address
subjectstringSubject line
created_atstringISO 8601 timestamp
{
  "email": {
    "id": "em_01hx...",
    "status": "queued",
    "from": "noreply@yourdomain.com",
    "to": "user@example.com",
    "subject": "Your order has shipped",
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Code examples

curl https://api.smail.dev/api/v1/emails \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "from": "noreply@yourdomain.com",
    "to": ["user@example.com"],
    "subject": "Your order has shipped",
    "html": "<p>Your order #1234 is on its way!</p>",
    "text": "Your order #1234 is on its way!"
  }'
const { email } = await smail.emails.send({
  from: "noreply@yourdomain.com",
  to: ["user@example.com"],
  subject: "Your order has shipped",
  html: "<p>Your order #1234 is on its way!</p>",
  text: "Your order #1234 is on its way!",
});
email, err := client.Emails.Send(ctx, smail.SendEmailRequest{
    From:    "noreply@yourdomain.com",
    To:      []string{"user@example.com"},
    Subject: "Your order has shipped",
    HTML:    "<p>Your order #1234 is on its way!</p>",
    Text:    "Your order #1234 is on its way!",
})

Error responses

StatusErrorDescription
401unauthorizedMissing or invalid API key
400from domain not verifiedThe from address domain is not verified
400invalid requestMissing required fields