The Marshmellos API is a REST API that uses JSON for request and response bodies.
https://api.marshmellos.com/v1All API requests require an API key in the Authorization header.
curl -X POST https://api.marshmellos.com/v1/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "[email protected]", ...}'Generate API keys in your dashboard settings.
/sendSend a transactional email immediately
{
"to": "[email protected]",
"from": "[email protected]",
"subject": "Welcome to our app",
"html": "<h1>Hello!</h1><p>Thanks for signing up.</p>",
"text": "Hello! Thanks for signing up."
}{
"id": "msg_01H8EXAMPLE",
"status": "sent",
"to": "[email protected]",
"created_at": "2024-01-15T10:30:00Z"
}/send/templateSend an email using a pre-defined template
{
"to": "[email protected]",
"template_id": "tmpl_welcome",
"variables": {
"name": "Alex",
"company": "Acme Inc"
}
}{
"id": "msg_01H8EXAMPLE",
"status": "sent",
"template_id": "tmpl_welcome",
"created_at": "2024-01-15T10:30:00Z"
}/emails/{id}Retrieve details and events for a specific email
{
"id": "msg_01H8EXAMPLE",
"status": "delivered",
"to": "[email protected]",
"subject": "Welcome to our app",
"events": [
{ "type": "sent", "timestamp": "2024-01-15T10:30:00Z" },
{ "type": "delivered", "timestamp": "2024-01-15T10:30:02Z" },
{ "type": "opened", "timestamp": "2024-01-15T10:35:12Z" }
]
}/emailsList all emails with optional filters
{
"data": [
{ "id": "msg_01H8ABC", "to": "[email protected]", "status": "delivered" },
{ "id": "msg_01H8DEF", "to": "[email protected]", "status": "sent" }
],
"has_more": true,
"cursor": "cur_01H8NEXT"
}/templatesCreate a reusable email template
{
"name": "Welcome Email",
"subject": "Welcome, {{name}}!",
"html": "<h1>Hi {{name}}</h1><p>Welcome to {{company}}.</p>",
"text": "Hi {{name}}, welcome to {{company}}."
}{
"id": "tmpl_01H8EXAMPLE",
"name": "Welcome Email",
"created_at": "2024-01-15T10:30:00Z"
}/domainsAdd a new sending domain for verification
{
"domain": "mail.yourdomain.com"
}{
"id": "dom_01H8EXAMPLE",
"domain": "mail.yourdomain.com",
"status": "pending",
"dns_records": [
{ "type": "TXT", "host": "_dmarc", "value": "v=DMARC1; p=none" },
{ "type": "CNAME", "host": "s1._domainkey", "value": "..." }
]
}/webhooksRegister a webhook endpoint for email events
{
"url": "https://yourapp.com/webhooks/email",
"events": ["delivered", "bounced", "opened", "clicked"]
}{
"id": "whk_01H8EXAMPLE",
"url": "https://yourapp.com/webhooks/email",
"events": ["delivered", "bounced", "opened", "clicked"],
"secret": "whsec_..."
}The API uses standard HTTP status codes. Here are the most common:
| Code | Name | Description |
|---|---|---|
| 400 | Bad Request | Invalid request body or parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | API key doesn't have required permissions |
| 404 | Not Found | Resource not found |
| 429 | Rate Limited | Too many requests, slow down |
| 500 | Server Error | Something went wrong on our end |
API requests are rate limited based on your plan:
Rate limit headers are included in every response:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 985
X-RateLimit-Reset: 1705312200Use our official SDKs for faster integration: