Email API Quick Reference

Quick-lookup reference for Cakemail Email API endpoints, SMTP configuration, headers, and response formats.

REST API Endpoints

MethodEndpointPurpose
POST/tokenObtain access token
POST/brands/default/sendersCreate a sender
GET/listsList contact lists
POST/v2/emailsSend an email
GET/v2/emails/:idCheck email status
GET/v2/emails/:id/renderRender email content
GET/v2/logs/emailsEmail activity logs
GET/v2/reports/emailsEmail reports

SMTP Configuration

SettingValue
Hostsmtp.cakemail.dev
Port465
EncryptionSSL/TLS (SMTPS)
AuthenticationCakemail username and password

SMTP Headers

Required

HeaderFormatPurpose
Fromsender@example.comValidated sender address
Torecipient@example.comSingle recipient only
SubjectTextEmail subject line
x-email-api-enabledtrueEnables Email API routing
x-list-id9234980Associates with contact list

Optional

HeaderFormatDefaultPurpose
x-email-api-typemarketing or transactionalmarketingEmail classification
x-tagstag1,tag2NoneTags for filtering

Email Types

TypeUse casesCharacteristics
marketingNewsletters, promotions, announcementsSubject to consent requirements, bulk-optimized
transactionalOrder confirmations, password resets, notificationsHigher priority delivery, must relate to user actions

Send Email (REST)

curl -X POST https://api.cakemail.dev/v2/emails \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "list_id": LIST_ID,
    "sender": { "id": SENDER_ID },
    "email": "recipient@example.com",
    "content": {
      "type": "marketing",
      "subject": "Hello",
      "html": "<html><body>Hello</body></html>",
      "encoding": "utf-8"
    }
  }'

Response Format

Successful Submission

{
  "email": "recipient@example.com",
  "object": "email",
  "submitted": true,
  "data": {
    "id": "3fbfa67e-c4c4-4e03-8dfd-556037960374",
    "status": "queued"
  }
}

Use data.id to track delivery status via GET /v2/emails/:id.

Best Practices

  • Authenticate your domain with SPF and DKIM before sending
  • Use lists for bounce handling and consent management
  • Handle token expiration — obtain a new token when the current one expires
  • Monitor delivery status for critical transactional emails
  • SMTP: single recipient only — make separate calls for multiple recipients
  • SMTP: attachments disabled by default — contact support to enable