API Documentation
Welcome to the QuickMailTo API documentation. This guide will help you integrate our email sending service into your application.
Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can find your API key in the dashboard after signing in.
Base URL
All API endpoints are relative to the base URL:
https://api.quickmailto.com
Rate Limits
API requests are rate limited to protect the service. Current limits:
- 60 requests per minute per API key
- Burst limit: 10 requests
Rate limit headers are included in every response:
X-RateLimit-Limit- Maximum requests per windowX-RateLimit-Remaining- Remaining requests in current windowX-RateLimit-Reset- Time when the rate limit resets
Send Message
Send an email message to one or more recipients.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Sender email address |
to | array | Yes | Array of recipient email addresses |
cc | array | No | Array of CC recipients |
bcc | array | No | Array of BCC recipients |
reply_to | string | No | Reply-to email address |
subject | string | Yes | Email subject line |
text | string | No* | Plain text body |
html | string | No* | HTML body |
template_id | string | No* | Template ID to use |
variables | object | No | Template variables |
tags | array | No | Tags for categorization |
metadata | object | No | Custom metadata |
* At least one of text, html, or template_id is required.
Example Request
curl -X POST https://api.quickmailto.com/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "sender@example.com",
"to": ["user@example.com"],
"subject": "Hello from QuickMailTo",
"text": "This is a test email.",
"html": "<h1>Hello!</h1><p>This is a test email.</p>"
}'
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func sendEmail() {
payload := map[string]interface{}{
"from": "sender@example.com",
"to": []string{"user@example.com"},
"subject": "Hello from QuickMailTo",
"text": "This is a test email.",
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST",
"https://api.quickmailto.com/v1/messages",
bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}
import requests
response = requests.post(
"https://api.quickmailto.com/v1/messages",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"from": "sender@example.com",
"to": ["user@example.com"],
"subject": "Hello from QuickMailTo",
"text": "This is a test email."
}
)
print(response.json())
const response = await fetch('https://api.quickmailto.com/v1/messages', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'sender@example.com',
to: ['user@example.com'],
subject: 'Hello from QuickMailTo',
text: 'This is a test email.'
})
});
const data = await response.json();
console.log(data);
Response
{
"success": true,
"data": {
"id": "msg_abc123",
"message_id": "<abc123@quickmailto.com>",
"status": "queued"
}
}
List Messages
Retrieve a paginated list of sent messages.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
per_page | integer | 20 | Items per page (max 100) |
Get Message
Retrieve details of a specific message.
Create Template
Create a reusable email template with variable placeholders.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name |
description | string | No | Template description |
subject | string | Yes | Email subject (supports variables) |
text_body | string | No | Plain text body |
html_body | string | No | HTML body |
variables | array | No | List of variable names |
List Templates
Get Template
Update Template
Delete Template
Create Webhook
Register a webhook endpoint to receive email events.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Webhook endpoint URL (must be HTTPS) |
events | array | Yes | Event types to subscribe to |
List Webhooks
Get Webhook
Update Webhook
Delete Webhook
List Events
Retrieve a list of email events.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by event type |
page | integer | Page number |
per_page | integer | Items per page |
Get Message Events
Retrieve all events for a specific message.
Error Codes
The API uses standard HTTP status codes and returns errors in a consistent format.
| Code | Name | Description |
|---|---|---|
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Access denied (inactive account, etc.) |
404 | Not Found | Resource not found |
409 | Conflict | Resource already exists |
429 | Too Many Requests | Rate limit or quota exceeded |
500 | Internal Error | Server error |
Error Response Format
{
"success": false,
"error": {
"code": "BAD_REQUEST",
"message": "Invalid email address format",
"details": { ... }
}
}
Event Types
The following event types can be tracked and delivered via webhooks:
| Event | Description |
|---|---|
created | Email message was created |
queued | Email was added to the send queue |
sent | Email was sent to the mail server |
delivered | Email was delivered to recipient |
bounced | Email bounced (hard or soft) |
complained | Recipient marked as spam |
opened | Recipient opened the email |
clicked | Recipient clicked a link |
failed | Email delivery failed |