🚀 Build with ZMAIL API.
💜 A friendly email API for developers, bots, websites, and automation. Authenticate with a Bearer key, send through one gateway endpoint, and monitor the shared daily pool in real time. ✨
🚀 Getting Started
Send an authenticated request to the developer send endpoint with your Bearer API key.
POST /api/v1/send Authorization: Bearer YOUR_API_KEY Content-Type: application/json
🔐 Authentication
Every request uses a Bearer API key in the Authorization header.
Authorization: Bearer YOUR_API_KEY
📊 Usage Limits
📊 Every authorized API key draws from a single shared pool of successful sends per WAT (UTC+1) calendar day. When any key uses a slot, the shared counter drops for every other key. The current limit is shown on the live status board.
| Request | Counts? |
|---|---|
Successful /api/v1/send | Yes |
| Invalid API key | No |
| Validation error | No |
| Provider / send failure | No |
| 429 response | No |
/api/upload | No |
/api/templates | No |
/api/check | No |
✉️ Send Email
POST/api/v1/send
{
"to": "recipient@example.com",
"subject": "Hello from ZMAIL",
"body": "<h1>Hello</h1><p>Your message here.</p>"
}
fetch("/api/v1/send", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
to: "recipient@example.com",
subject: "Hello from ZMAIL",
body: "<p>Hello!</p>"
})
});
🖼️ Send With Image
Attach exactly one image per email by passing a base64 data URI in image_base64. The server uploads it to ImgBB and injects the hosted URL into your body automatically.
Body fields
| Field | Required | Notes |
|---|---|---|
image_base64 | No | Data URI — data:image/jpeg;base64,... |
image_alt | No | Alt text |
image_width | No | Pixel width, e.g. 600 |
image_position | No | start · end (default) · replace |
Basic example
{
"to": "recipient@example.com",
"subject": "Photo attached",
"body": "<h1>Look at this</h1>",
"image_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"image_width": 600,
"image_position": "end"
}
Position the image with {{image}}
{
"body": "<p>Before</p>{{image}}<p>After</p>",
"image_base64": "data:image/jpeg;base64,...",
"image_position": "replace"
}
<img src="..."> directly in the body HTML.Standalone upload endpoint
POST/api/upload
const form = new FormData();
form.append("image", imageFile); // field name is "image"
const response = await fetch("/api/upload", {
method: "POST",
body: form
});
const { url } = await response.json();
console.log(url); // https://i.ibb.co/...
📝 Templates
GET/api/templates
const response = await fetch("/api/templates");
const data = await response.json();
console.log(data.templates);
🌍 Every Language & Platform
Copy-paste examples for sending email through /api/v1/send. Pick your stack from the list. Every example uses the same core pattern: Bearer auth, JSON body, POST request.
Loading…
⚠️ Errors
| Status | Meaning |
|---|---|
| 400 | Invalid request data or invalid image request |
| 401 | Missing or invalid API key |
| 405 | HTTP method not allowed |
| 413 | Request / image too large |
| 415 | Unsupported media type |
| 429 | Shared daily pool exhausted |
| 500 | Server or provider failure |
| 503 | Quota tracking not configured on server |
🧪 API Key Tester
🧪 Enter an API key to validate it and populate the live dashboard above. The key is kept in this browser session only.
🛡️ Security
- 🔒 Keep API keys server-side — never in browser bundles.
- 🚫 Never commit provider credentials to Git.
- 🧱 Never expose the Supabase service-role key.
- 🔁 Rotate a key immediately if you suspect a leak.
- 🌐 Always use HTTPS for outbound API calls.
- 🎯 Validate recipients before sending.
🔧 Troubleshooting
401 — Invalid API key
Confirm the key is authorized and the header is Authorization: Bearer <key>.
429 — Daily limit
Check the shared pool with the tester above. Resets at 00:00 WAT (UTC+1).
500 — Server error
Check server logs and the Supabase schema. Provider failures do not consume a slot.
400 — Invalid image request
The detail field names the exact rule violated: mixed sources, more than one image, or a malformed data URI.