One request sends one email. Mailcandor checks it, stores it and queues it, then answers straight away.
To send an email
curl https://api.mailcandor.com/v1/emails \
-H "Authorization: Bearer $MAILCANDOR_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme <hello@acme.com>",
"to": ["sam@example.com"],
"subject": "Your receipt",
"html": "<p>Thanks for your order.</p>",
"reply_to": "support@acme.com"
}'
Answer, 202 Accepted:
{ "id": "3f1c0e2a-6a7b-4c51-9d0e-8f1a2b3c4d5e", "status": "queued" }
Keep the id. It links the email to its events and webhooks. Any key type can send, including sending-only keys.
Fields
| Field | Type | Notes |
|---|---|---|
from |
string | Required. Must be on a domain your team has verified. Name <address> works. |
to |
string or list | Required. |
cc, bcc |
string or list | Optional. to + cc + bcc can hold at most 50 addresses. |
reply_to |
string or list | Optional. |
subject |
string | Required. |
html |
string | html, text or both. |
text |
string | Made from html if you leave it out. |
headers |
object | Extra headers, for example {"X-Entity-Ref-ID": "1042"}. See Tags and headers. |
tags |
list | Your own labels, returned in webhooks. See Tags and headers. |
attachments |
list | Base64 files, up to 40 MB in total. See Attachments. |
scheduled_at |
string | Send later, up to 30 days ahead. See Scheduled emails. |
template |
object | {"id", "variables"} to send a stored template instead of html/text. See Templates. |
Add an Idempotency-Key header to make retries safe. See Idempotency.
The same request in Node.js
const res = await fetch('https://api.mailcandor.com/v1/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MAILCANDOR_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'order-1042-receipt',
},
body: JSON.stringify({
from: 'Acme <hello@acme.com>',
to: 'sam@example.com',
subject: 'Your receipt',
html: '<p>Thanks for your order.</p>',
}),
});
if (!res.ok) {
const { error } = await res.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { id } = await res.json();
To follow the email
With a full-access key:
curl https://api.mailcandor.com/v1/emails/3f1c0e2a-6a7b-4c51-9d0e-8f1a2b3c4d5e \
-H "Authorization: Bearer $MAILCANDOR_KEY"
You get its status and an events list. Bounces include an explanation with title, meaning, next_step and permanent. Statuses are scheduled, queued, sent, delivered, delivery_delayed, bounced, complained, opened, clicked, failed, canceled and suppressed.
To list recent emails: GET /v1/emails?limit=20, optionally with status=bounced. In the dashboard, open Emails, where you can filter by status, domain, recipient, tag and date.
Already using Resend, SendGrid or Postmark?
You can keep your SDK. Set RESEND_BASE_URL=https://api.mailcandor.com/v1 for Resend, point SendGrid at https://api.mailcandor.com (POST /v3/mail/send), or Postmark at api.mailcandor.com (POST /email with X-Postmark-Server-Token). Use a Mailcandor key in each case. Stored SendGrid and Postmark templates are not supported: send rendered HTML.
If it does not work
| Error | Fix |
|---|---|
401 missing_api_key |
Add Authorization: Bearer mc_live_.... |
403 domain_not_verified |
Verify the from domain under Domains. |
403 restricted_api_key |
The key is limited to another domain. |
422 missing_required_field |
field names the missing one. |
422 validation_error on to |
More than 50 recipients, or an address is not valid. |
429 rate_limit_exceeded |
Wait one second, or use batch sending. |
Status suppressed |
The address is on your suppression list after a bounce, complaint or unsubscribe. |
All types are in the Error codes reference. Full reference: docs.mailcandor.com.