API Reference
Manage blog posts and images programmatically. All endpoints are authenticated with an API key and return JSON.
Overview
Base URL
https://www.mailexel.com
Format
JSON
Auth
X-API-Key header
All endpoints
/api/v1/imagesUpload an image file
/api/v1/imagesList all uploaded images
/api/v1/images/:filenameDelete an image by filename
/api/v1/blogsList blog posts with filtering & pagination
/api/v1/blogsCreate a new blog post
/api/v1/blogs/:idGet a single blog post
/api/v1/blogs/:idUpdate a blog post
/api/v1/blogs/:idDelete a blog post
Authentication
Every request must include your API key in the X-API-Key header. Contact your administrator to obtain an API key or set the EXTERNAL_API_KEY environment variable on the server.
curl -X GET "https://www.mailexel.com/api/v1/images" \
-H "X-API-Key: your_api_key_here"Images
Upload, list, and delete images hosted on MailExel's CDN. Uploaded images are publicly accessible via /uploads/filename.
/api/v1/imagesUpload an image file. The request body must be multipart/form-data.
Request fields
| Field | Type | Description |
|---|---|---|
imagerequired | File | Image file. Max 5 MB. Allowed: jpeg, png, gif, webp. |
cURL
curl -X POST "https://www.mailexel.com/api/v1/images" \
-H "X-API-Key: your_api_key_here" \
-F "image=@/path/to/screenshot.png"JavaScript (fetch)
const form = new FormData();
form.append("image", fileInput.files[0]);
const res = await fetch("https://www.mailexel.com/api/v1/images", {
method: "POST",
headers: { "X-API-Key": "your_api_key_here" },
body: form,
});
const data = await res.json();
console.log(data.data.url); // "/uploads/screenshot.png"Python (requests)
import requests
with open("screenshot.png", "rb") as f:
res = requests.post(
"https://www.mailexel.com/api/v1/images",
headers={"X-API-Key": "your_api_key_here"},
files={"image": f},
)
print(res.json()["data"]["url"]) # /uploads/screenshot.pngResponse — 201 Created
{
"success": true,
"data": {
"filename": "screenshot.png",
"url": "/uploads/screenshot.png",
"publicUrl": "https://bmt4alccllpf5daq.public.blob.vercel-storage.com/uploads/screenshot.png",
"size": 248320,
"type": "image/png"
}
}/api/v1/imagesReturns all uploaded images sorted by upload date (newest first).
cURL
curl "https://www.mailexel.com/api/v1/images" \
-H "X-API-Key: your_api_key_here"Response — 200 OK
{
"success": true,
"total": 2,
"data": [
{
"filename": "hero-image.png",
"url": "/uploads/hero-image.png",
"publicUrl": "https://bmt4alccllpf5daq.public.blob.vercel-storage.com/uploads/hero-image.png",
"size": 512000,
"createdAt": "2026-05-31T10:00:00.000Z"
}
]
}/api/v1/images/:filenamePermanently deletes an image. Use the filename value returned by the upload or list endpoints.
cURL
curl -X DELETE "https://www.mailexel.com/api/v1/images/screenshot.png" \
-H "X-API-Key: your_api_key_here"Response — 200 OK
{
"success": true,
"message": "Image 'screenshot.png' deleted successfully."
}Blogs
Create, read, update, and delete blog posts. All endpoints require API key authentication.
/api/v1/blogsList blog posts with optional filtering and pagination.
Query parameters
| Param | Default | Description |
|---|---|---|
status | all | Filter by status: published | draft | all |
page | 1 | Page number |
limit | 20 | Results per page (max 100) |
search | — | Search in title and excerpt |
category | — | Filter by category name |
tag | — | Filter by tag |
curl "https://www.mailexel.com/api/v1/blogs?status=published&limit=10&page=1" \
-H "X-API-Key: your_api_key_here"/api/v1/blogsCreate a new blog post. Slug is auto-generated from the title.
curl -X POST "https://www.mailexel.com/api/v1/blogs" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"title": "How to Convert PST to MBOX",
"excerpt": "A step-by-step guide to converting PST files.",
"content": "<h2>Introduction</h2><p>...</p>",
"status": "published",
"category": "Email Conversion",
"tags": ["pst", "mbox", "conversion"],
"featuredImage": "/uploads/hero-image.png"
}'Errors
All errors return a JSON body with success: false and a human-readable message.
| Status | Meaning |
|---|---|
400 | Bad request — missing or invalid fields |
401 | Invalid or missing X-API-Key header |
404 | Resource not found |
500 | Server error — check message for details |
503 | API disabled — EXTERNAL_API_KEY not configured |
Error response example
{
"success": false,
"message": "Invalid or missing API key. Pass it via the X-API-Key header."
}