Send Email

Send transactional emails using our REST API.

Endpoint

POST https://getmailer.co/api/emails

Request Body

{
  "from": "sender@yourdomain.com",
  "to": "recipient@example.com",
  "subject": "Your subject line",
  "html": "<h1>Hello!</h1>",
  "text": "Hello! (plain text fallback)",
  "cc": ["cc@example.com"],
  "bcc": ["bcc@example.com"],
  "replyTo": "reply@yourdomain.com",
  "tags": ["welcome", "onboarding"],
  "headers": {
    "X-Custom-Header": "value"
  }
}

Parameters

FieldTypeDescription
fromstringSender email address (required)
tostring | string[]Recipient(s) (required)
subjectstringEmail subject (required)
htmlstringHTML content (html or text required)
textstringPlain text content
ccstring | string[]CC recipients
bccstring | string[]BCC recipients
replyTostringReply-to address
tagsstring[]Tags for filtering (max 10)
headersobjectCustom email headers
templateIdstringTemplate ID to use
variablesobjectTemplate variables
scheduledAtstringISO 8601 datetime to send (max 7 days)

Response

{
  "id": "clx1abc123def456",
  "from": "sender@yourdomain.com",
  "to": ["recipient@example.com"],
  "subject": "Your subject line",
  "status": "sent",
  "tags": ["welcome", "onboarding"]
}

cURL Example

curl -X POST https://getmailer.co/api/emails \
  -H "Authorization: Bearer gm_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "sender@yourdomain.com",
    "to": "recipient@example.com",
    "subject": "Hello from GetMailer",
    "html": "<h1>It works!</h1><p>Your email was sent successfully.</p>"
  }'

Using Templates

Instead of providing html/text, use a template:

{
  "from": "sender@yourdomain.com",
  "to": "recipient@example.com",
  "templateId": "your-template-id",
  "variables": {
    "name": "John",
    "orderNumber": "12345"
  }
}

See Templates for more information.

Related

Send Email - GetMailer Docs | GetMailer