A sending API compatible with Postal and Amazon SES
Send transactional email over HTTPS with an API key in a header. If your system already talks to Postal or Amazon SES, change the endpoint and the credentials and keep the rest.
Two interfaces, one delivery path
Both interfaces are served at https://api.frontengine.net, over HTTPS only, and feed the same queue the SMTP relay uses.
Postal-compatible
POST /api/v1/send/messagetakes the message as JSON.POST /api/v1/send/rawtakes a message you already built in RFC 5322 format. The key goes in theX-Server-API-Keyheader.Amazon SES v2-compatible
POST /v2/email/outbound-emailswith SigV4 signing, in the Simple and Raw formats. The AWS SDKs work with a custom endpoint.Amazon SES v1-compatible
The
SendEmail,SendRawEmailandGetSendQuotaactions of the Query API, also with SigV4, for systems still on the earlier version.The key never goes in the body
Authentication uses HTTP headers. Keep the key in an environment variable or a secrets manager.
Sending with the Postal-compatible API
A simple message with text and HTML. Each of the to, cc and bcc fields accepts up to 50 addresses.
curl -X POST "https://api.frontengine.net/api/v1/send/message" \
-H "X-Server-API-Key: $FRONTENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Your order is confirmed",
"plain_body": "We received your order 1234.",
"html_body": "<p>We received your order <strong>1234</strong>.</p>"
}'
import os
import requests
resp = requests.post(
"https://api.frontengine.net/api/v1/send/message",
headers={"X-Server-API-Key": os.environ["FRONTENGINE_API_KEY"]},
json={
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Your order is confirmed",
"plain_body": "We received your order 1234.",
"html_body": "<p>We received your order <strong>1234</strong>.</p>",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())
// Node 18 or later (built-in fetch)
const resp = await fetch("https://api.frontengine.net/api/v1/send/message", {
method: "POST",
headers: {
"X-Server-API-Key": process.env.FRONTENGINE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
from: "[email protected]",
to: ["[email protected]"],
subject: "Your order is confirmed",
plain_body: "We received your order 1234.",
html_body: "<p>We received your order <strong>1234</strong>.</p>",
}),
});
if (!resp.ok) throw new Error(`Send failed: ${resp.status}`);
console.log(await resp.json());
Sending with the AWS SDKs
Point the SDK's SES client at the FrontEngine endpoint and use the access key and secret of your SES-compatible credential. The region used for signing is in the documentation.
import os
import boto3
ses = boto3.client(
"sesv2",
endpoint_url="https://api.frontengine.net",
region_name=os.environ["FRONTENGINE_SES_REGION"],
aws_access_key_id=os.environ["FRONTENGINE_SES_KEY_ID"],
aws_secret_access_key=os.environ["FRONTENGINE_SES_SECRET"],
)
ses.send_email(
FromEmailAddress="[email protected]",
Destination={"ToAddresses": ["[email protected]"]},
Content={
"Simple": {
"Subject": {"Data": "Your order is confirmed"},
"Body": {"Text": {"Data": "We received your order 1234."}},
}
},
)
import { SESv2Client, SendEmailCommand } from "@aws-sdk/client-sesv2";
const ses = new SESv2Client({
endpoint: "https://api.frontengine.net",
region: process.env.FRONTENGINE_SES_REGION,
credentials: {
accessKeyId: process.env.FRONTENGINE_SES_KEY_ID,
secretAccessKey: process.env.FRONTENGINE_SES_SECRET,
},
});
await ses.send(new SendEmailCommand({
FromEmailAddress: "[email protected]",
Destination: { ToAddresses: ["[email protected]"] },
Content: {
Simple: {
Subject: { Data: "Your order is confirmed" },
Body: { Text: { Data: "We received your order 1234." } },
},
},
}));
What the API does and does not do
| Capability | Status |
|---|---|
| JSON sending with text, HTML, headers and attachments | Available |
| Sending a prebuilt (raw) message | Available |
Amazon SES v2 (Simple and Raw) and v1 (SendEmail, SendRawEmail) | Available |
| Delivery outcome | Through webhooks, in real time |
| Reading messages back through the API | Limited: it does not return bodies, attachments or the attempt history |
| Templates and per-recipient variables | Not available. Your system builds the content of each message |
| SES bulk sending and identities | Not available. These calls are refused |
| Scheduled sending | Not available |
To follow what happened to each message, use webhooks instead of polling the API.
Frequently asked questions
Do I need to install a FrontEngine SDK?
No. FrontEngine does not publish SDKs of its own. Use any HTTP client, a library written for Postal, or the official AWS SDKs with the https://api.frontengine.net endpoint.
What is the maximum message size?
50 MB, attachments included.
Does GetSendQuota reflect my plan?
No. The call exists to stay compatible with systems that check it before sending, and it returns fixed values. Your contracted volume is the one in your plan.
Does the API accept unencrypted HTTP?
No. The API is served over HTTPS only.
Send your first message through the API
Choose a plan, verify your domain and use the examples in the documentation to integrate.