Skip to content

API Endpoints

The Mailiam API provides RESTful endpoints for managing forms, sending emails, and processing submissions.

https://api.mailiam.io

Include your API key in the Authorization header:

Terminal window
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.mailiam.io/api/forms

Submit data to a form endpoint.

Terminal window
curl -X POST https://api.mailiam.io/submit/contact \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john@example.com",
"message": "Hello world"
}'

Response:

{
"success": true,
"message": "Form submitted successfully"
}

List all forms for your account.

Terminal window
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.mailiam.io/api/forms

Response:

{
"forms": [
{
"id": "contact",
"name": "Contact Form",
"submissions": 42,
"created_at": "2024-01-01T00:00:00Z"
}
]
}

Create a new form.

Terminal window
curl -X POST https://api.mailiam.io/api/forms \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Newsletter Signup",
"to": "admin@example.com",
"subject": "New Newsletter Subscription"
}'

Send a transactional email.

Terminal window
curl -X POST https://api.mailiam.io/api/email/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "user@example.com",
"subject": "Welcome!",
"template": "welcome",
"data": {
"name": "John Doe"
}
}'

All endpoints return consistent error responses:

{
"error": true,
"message": "Invalid API key",
"code": 401
}
  • Free Plan: 100 requests/hour
  • Pro Plan: 1,000 requests/hour
  • Enterprise: Custom limits

Rate limit headers are included in all responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200