Quick-lookup reference for Cakemail Email API endpoints, SMTP configuration, headers, and response formats.
REST API Endpoints
| Method | Endpoint | Purpose |
|---|
| POST | /token | Obtain access token |
| POST | /brands/default/senders | Create a sender |
| GET | /lists | List contact lists |
| POST | /v2/emails | Send an email |
| GET | /v2/emails/:id | Check email status |
| GET | /v2/emails/:id/render | Render email content |
| GET | /v2/logs/emails | Email activity logs |
| GET | /v2/reports/emails | Email reports |
SMTP Configuration
| Setting | Value |
|---|
| Host | smtp.cakemail.dev |
| Port | 465 |
| Encryption | SSL/TLS (SMTPS) |
| Authentication | Cakemail username and password |
SMTP Headers
Required
| Header | Format | Purpose |
|---|
From | sender@example.com | Validated sender address |
To | recipient@example.com | Single recipient only |
Subject | Text | Email subject line |
x-email-api-enabled | true | Enables Email API routing |
x-list-id | 9234980 | Associates with contact list |
Optional
| Header | Format | Default | Purpose |
|---|
x-email-api-type | marketing or transactional | marketing | Email classification |
x-tags | tag1,tag2 | None | Tags for filtering |
Email Types
| Type | Use cases | Characteristics |
|---|
marketing | Newsletters, promotions, announcements | Subject to consent requirements, bulk-optimized |
transactional | Order confirmations, password resets, notifications | Higher 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