Documentation
The MailForge API is plain JSON over HTTPS. Base URL: https://mailforge.softunify.com/api/v1
Quickstart
1. Add and verify your domain. 2. Create an API key with the emails:send scope. 3. Send:
curl -X POST "https://mailforge.softunify.com/api/v1/emails" \
-H "Authorization: Bearer $MAILFORGE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042" \
-d '{
"from": "Acme <receipts@acme.com>",
"to": "anna@northwind.io",
"subject": "Your receipt #1042",
"html": "<p>Thanks for your order, Anna.</p>"
}'Authentication
Send your API key as a bearer token. Keys start with mf_ and are shown once, when you create them.
Authorization: Bearer mf_your_api_keyEach key has scopes. A request outside its scopes is refused with 403.
| Scope | Allows |
|---|---|
emails:send | Send email by API, SMTP or MCP |
emails:read | Read emails and their events |
templates:manage | Create and change templates |
domains:manage | Add, verify and remove domains |
webhooks:manage | Manage webhook endpoints |
suppressions:manage | Read and change the suppression list |
marketing:manage | Contacts, lists, campaigns, automations |
outreach:manage | Mailboxes, prospects, sequences, replies |
verify | Email verification |
deliverability:read | Deliverability reports |
Errors
Errors use the HTTP status code and the same JSON shape:
{ "error": { "code": "validation_error", "message": "to: Invalid email" } }| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | The key lacks the scope, or sending is paused |
404 | Not found in your account |
409 | Conflict, for example a domain already in use |
422 | The request body is invalid |
429 | Too many requests; retry after a pause |
Domains
You send from your own domain. After you add it, MailForge shows these records. Sending starts once the required ones are found; they are re-checked every 6 hours.
| Type | Name | Value |
|---|---|---|
| TXT | _mailforge.example.com | mailforge-verify=… |
| TXT | mf1._domainkey.example.com | v=DKIM1; k=rsa; p=… |
| MX 10 | bounce.example.com | relay.softunify.com |
| TXT | bounce.example.com | v=spf1 include:_spf.mail.softunify.com -all |
| TXT | _dmarc.example.com | v=DMARC1; p=none; … (recommended) |
Send an email
POST /v1/emails — needs emails:send. Give html, text or a template_id.
| Field | Type | Notes |
|---|---|---|
from | string | Required. "Name <you@your-domain.com>" on a verified domain |
to | string | string[] | Required. Up to 50 addresses |
cc, bcc | string | string[] | Optional |
reply_to | string | Optional |
subject | string | Required unless the template has one |
html, text | string | The body |
template_id | uuid | Use a saved template |
variables | object | Values for {{placeholders}} |
headers | object | Extra headers |
tags | string[] | Your labels, returned in events |
priority | "high" | "normal" | high for codes and alerts |
scheduled_at | ISO 8601 | Up to 30 days ahead |
attachments | array | { filename, content (base64), content_type }, 10 MB total |
Add an Idempotency-Key header to retry safely. The response:
{ "id": "6f0c2d8e-…", "status": "queued", "suppressed": [], "duplicate": false }Recipients on your suppression list are listed in suppressed and skipped. POST /v1/emails/batch takes an array of up to 100 of the same objects.
Read and cancel
GET /v1/emails/:id returns the email with its delivery events. POST /v1/emails/:id/cancel stops a scheduled email that has not been sent.
Templates
Save a subject and body with {{name}} placeholders, then send with template_id and variables. POST /v1/templates/:id/render previews the result.
SMTP
Use the relay from any app that sends over SMTP. STARTTLS is required.
Host api.mail.softunify.com
Port 2525
Security STARTTLS
Username apikey
Password an API key with emails:sendWebhooks
Add an HTTPS endpoint and choose events: email.sent, email.delivered, email.deferred, email.bounced, email.complained, email.failed, email.suppressed. Each delivery is a POST:
{ "type": "email.delivered", "created_at": "…", "data": { "email_id": "…", "recipient": "anna@northwind.io" } }Answer with any 2xx within 10 seconds. Failed deliveries are retried 8 times over about two days. Check the mf-signature header before you trust a request:
import { createHmac, timingSafeEqual } from "node:crypto";
// header: mf-signature: t=1767225600,v1=<hex>
function verify(header, rawBody, secret) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const want = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
return fresh && timingSafeEqual(Buffer.from(want), Buffer.from(v1));
}Verification
POST /v1/verify with { "email": "…" } checks one address. POST /v1/verify/bulk with { "emails": [...] } starts a job of up to 50,000 addresses; set suppress_invalid to add invalid ones to your suppression list. Every result has a status (valid, invalid, risky, unknown), an action (send, care, remove), a score and a typo suggestion when there is one.
MCP server
Connect any MCP client over Streamable HTTP. The key's scopes decide which of the 30 tools the agent can use.
URL https://mailforge.softunify.com/api/v1/mcp
Auth Authorization: Bearer mf_your_api_keyTools include send_email, list_emails, verify_email, verify_list, create_campaign, spam_check_campaign, import_prospects, list_replies, get_deliverability and add_suppression.
All endpoints
Emails
- POST /v1/emails
- POST /v1/emails/batch
- GET /v1/emails
- GET /v1/emails/:id
- POST /v1/emails/:id/cancel
Templates
- GET /v1/templates
- POST /v1/templates
- GET /v1/templates/:id
- PUT /v1/templates/:id
- DELETE /v1/templates/:id
- POST /v1/templates/:id/render
Domains
- GET /v1/domains
- POST /v1/domains
- GET /v1/domains/:id
- POST /v1/domains/:id/verify
- DELETE /v1/domains/:id
Webhooks
- GET /v1/webhooks
- POST /v1/webhooks
- PATCH /v1/webhooks/:id
- DELETE /v1/webhooks/:id
- POST /v1/webhooks/:id/test
- GET /v1/webhooks/:id/deliveries
Suppressions
- GET /v1/suppressions
- POST /v1/suppressions
- DELETE /v1/suppressions/:id
Verification
- POST /v1/verify
- POST /v1/verify/bulk
- GET /v1/verify/jobs
- GET /v1/verify/jobs/:id
- GET /v1/verify/jobs/:id/results
- POST /v1/verify/jobs/:id/cancel
Marketing
- /v1/contacts
- /v1/contacts/import
- /v1/lists
- /v1/campaigns
- /v1/campaigns/:id/test
- /v1/campaigns/:id/schedule
- /v1/campaigns/:id/spam-check
- /v1/automations
Outreach
- /v1/outreach/mailboxes
- /v1/outreach/prospects
- /v1/outreach/prospects/import
- /v1/outreach/sequences
- /v1/outreach/sequences/:id/enroll
- /v1/outreach/replies
Deliverability
- GET /v1/deliverability
- POST /v1/deliverability/content-check