Send an email, and get the reply
SimpleFlare is a transactional email API and a shared inbox in one place. Send from a project key, render from templates or your own HTML, and handle every reply from a unified inbox. This guide covers everything you need to go live.
https://simpleflare.app/api/email/send
Overview
SimpleFlare treats sending and receiving as two halves of the same conversation. Your product calls one REST endpoint to send transactional email; the replies land in a unified inbox where your team answers them. Every business you run gets its own sender identity, templates, and inbox, all managed from one hub.
Send
One endpoint per project, authenticated with a rotating key. Template, wrapped HTML, or fully rendered HTML.
Receive
Inbound mail is threaded per project in a shared inbox with inline replies.
Deliver
Open, click, and bounce tracking, an automatic suppression list, and one-click unsubscribe.
Your first send
Every request goes to the endpoint above. Reference a stored template and pass its data: the template, the sender and the design all come from the project the key belongs to.
curl -X POST https://simpleflare.app/api/email/send \
-H "X-Project-Key: sk_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"template": "welcome",
"to": "user@example.com",
"vars": { "name": "Ann" }
}'
# => {"ok":true}
Http::withHeaders(['X-Project-Key' => config('services.simpleflare.key')])
->post('https://simpleflare.app/api/email/send', [
'template' => 'welcome',
'to' => $user->email,
'vars' => ['name' => $user->name],
]);
await fetch('https://simpleflare.app/api/email/send', {
method: 'POST',
headers: {
'X-Project-Key': process.env.SIMPLEFLARE_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ template: 'welcome', to: user.email, vars: { name: user.name } }),
});
That is the whole loop: the API renders your project's welcome template with the data you passed and sends it from that project's support@ identity.
Authentication
Each project has its own Send API key, shown in the admin under the project's email templates. Pass it on every request in the X-Project-Key header. The key both authenticates the call and selects which project (identity, templates, design) the email is sent from.
| Header | Value |
|---|---|
X-Project-Key | Your project's secret key, e.g. sk_live_.... Rotate it any time from the admin; the old key stops working immediately. |
Content-Type | application/json |
Keep the key server-side. It can send email as your brand, so treat it like any other secret and never ship it in client-side code.
Send from a template
Reference a stored template by key and pass its data in vars. Four variables reach every template without being passed:
| Variable | Comes from |
|---|---|
brand | The project's name as your customers see it |
app_url | The project's domain, as https:// |
login_url | The project's domain with /login |
support_email | The project's sending address, support@ its domain unless you set another |
curl -X POST https://simpleflare.app/api/email/send \
-H "X-Project-Key: sk_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"template": "welcome",
"to": "user@example.com",
"vars": { "name": "Ann", "plan": "Studio" }
}'
Dynamic HTML (loops, model data)
Most real emails (order confirmations, digests) are code: they loop over line items and translated strings that do not fit a string template. Render that content in your own app and pass it as content_html. SimpleFlare wraps it in the project's design shell and sends it from the project identity, so it still matches your brand.
curl -X POST https://simpleflare.app/api/email/send \
-H "X-Project-Key: sk_your_project_key" -H "Content-Type: application/json" \
-d '{
"to": "buyer@example.com",
"subject": "Order #1234 confirmed",
"content_html": "<h1>Thanks!</h1><table>...your rows...</table>"
}'
Rule of thumb: simple emails (welcome, notifications) use template; dynamic emails render in your app and use content_html. Either way, every email leaves with one unified design and identity.
Fully rendered HTML
If your project renders the complete email, including its own <html> shell, send it as html and SimpleFlare relays it as-is with no wrapping. Optional from, from_name, and text override the identity and add a plain-text part.
curl -X POST https://simpleflare.app/api/email/send \
-H "X-Project-Key: sk_your_project_key" -H "Content-Type: application/json" \
-d '{
"to": "buyer@example.com",
"subject": "Order #1234 confirmed",
"html": "<!doctype html><html>...full email...</html>"
}'
Recipients, CC and BCC
to is required; cc and bcc are optional. Each field accepts a single email string, an array of emails, or an array of {email, name} objects, and you can mix those freely. Invalid addresses are dropped, and each field is capped at 50 recipients.
To have replies go somewhere other than the project's reply address, pass "headers": {"Reply-To": "ann@example.com"}. It takes exactly one plain address; a list, a display name or a line break is refused with 422 and nothing is sent.
In-Reply-To and References in headers keep an answer in the customer's thread. They pass when they hold <id>s only; any other value is left off and the letter still goes.
curl -X POST https://simpleflare.app/api/email/send \
-H "X-Project-Key: sk_your_project_key" -H "Content-Type: application/json" \
-d '{
"template": "notify",
"to": ["ann@example.com", {"email": "ben@example.com", "name": "Ben"}],
"cc": "manager@example.com",
"bcc": ["audit@example.com"],
"vars": { "name": "Team" }
}'
| Field | Required | Notes |
|---|---|---|
to | Yes | String, array, or {email,name} objects. Max 50. |
template / content_html / html | One of | How the body is produced. See the sending sections above. |
subject | For HTML sends | Templates carry their own subject; HTML sends set it here. |
vars | No | Data for template placeholders. Auto vars are added for you. |
cc, bcc | No | Same shapes as to. Max 50 each. |
Receiving replies
Every project has a support@<domain> address. Inbound mail is parsed and threaded into the unified inbox, grouped by project, where your team reads and replies inline. Replies go out wrapped in that project's design, so a conversation stays on-brand from the first send to the last answer.
Attachments on inbound mail are stored with a 25MB cap. Dangerous executable types are blocked for safety and shown as blocked rather than downloaded.
Already on Google Workspace or Microsoft 365? You can route just your support address into SimpleFlare and leave everything else untouched. See the step-by-step guide: Use SimpleFlare for support email, keep Google or Microsoft.
Replies to your site
When your own app answers a customer, it can get the customer's answer back as well. Set an address under the project's Replies to your site and send with "headers": {"Reply-To": "info+1042@yourdomain.com"}, where 1042 is anything your app recognises. A reply to that address, or one that quotes a letter the project sent, is posted to your app as JSON and stays in the inbox too.
POST https://yourdomain.com/mail-reply
X-SimpleFlare-Event: inbound.reply
X-SimpleFlare-Timestamp: 1794150000
X-SimpleFlare-Signature: v1=hex(HMAC-SHA256(secret, timestamp + "." + raw body))
{"event": "inbound.reply", "project": "shop", "to": "info+1042@yourdomain.com", "detail": "1042",
"replies_to_id": 951, "from_email": "ann@example.com", "from_name": "Ann", "subject": "Re: Your order",
"text": "Tuesday suits me.", "message_id": "<...>", "in_reply_to": "<...>", "references": "<...>",
"date": "2026-11-08T14:00:00+00:00", "attachments": [{"filename": "plan.pdf", "mime": "application/pdf", "size": 48211}]}
detail is lower-cased, and empty when the reply was matched only by the letter it quotes. replies_to_id is the id your send returned. Answer 2xx to accept it. A 5xx or no answer within 10 seconds is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours, each time with a new signature. Any 4xx is final.
Live chat widget
Add a chat bubble to any website with one line. Visitors message you, and their messages land in the same inbox as your email, threaded per project. You answer from the inbox and your replies appear in the visitor's chat in seconds. Each project gets its own public widget key (pk_...), which is safe to put in your page.
Install
Paste this once, right before the closing </body> tag, on every page where you want the bubble:
<!-- from SimpleFlare admin: Projects → your project → Live chat -->
<script src="https://simpleflare.app/widget/embed" data-key="pk_your_widget_key" async></script>
Works on plain HTML, WordPress (footer / a headers-and-footers plugin), Shopify (theme.liquid), Webflow (Footer Code), or Google Tag Manager (a Custom HTML tag on All Pages). It loads asynchronously and never blocks your page.
Tell it who is signed in
Optional, and the thing most people wish they had added first. Without it a signed-in customer arrives in your inbox as Anonymous, with no address to reply to. Add two attributes to the same tag:
<script src="https://simpleflare.app/widget/embed" data-key="pk_your_widget_key"
data-name="{{ user.name }}"
data-email="{{ user.email }}" async></script>
If people sign in without the page reloading, those attributes were already read. Call this instead, any time after login:
SimpleFlare.identify({ name: 'Bella Pavlova', email: 'bella@example.com' })
This is a claim, not proof. The widget key is public, so anyone can send any address. It is enough to know who you are replying to; do not use it to decide what someone is allowed to see. If your chat should ever reveal account data, ask us for signed identity - your server signs the address with a secret only the two of us hold, and we verify it before trusting the name.
Prove who is writing
The attributes above are a claim. If your chat should ever show account or order data, sign the address on your server first. Take the signing secret from Projects → your project → Live chat, keep it server-side, and send the digest of the lowercased address:
// PHP hash_hmac('sha256', strtolower($user->email), $secret)
// Node crypto.createHmac('sha256', secret).update(email.toLowerCase()).digest('hex')
// Ruby OpenSSL::HMAC.hexdigest('SHA256', secret, email.downcase)
Pass it as data-hash (or identify({ name, email, hash })). A verified visitor carries a green badge in our inbox, so your team can see at a glance whether an address is proven or merely asserted.
A wrong or missing signature never blocks the message - the visitor still reaches you, just without the badge. Someone with a real problem must always be able to write to support.
Content Security Policy
If your site sends a Content-Security-Policy header, allow SimpleFlare in two directives, or the widget will silently not load:
script-src ... https://simpleflare.app;
connect-src ... https://simpleflare.app;
Chat without email
Chat works on its own, you do not need to set up email. Create a project, turn the widget on, and embed the snippet. Visitor messages arrive in the inbox and your replies reach them through the widget (no email is sent). If a visitor leaves an email or phone in their message, you will see it in the thread so you can follow up later.
Languages
The widget is bilingual (English and Bulgarian). It reads your page's <html lang> and shows the matching language, and it switches live the moment the site language changes. Set the greeting, reply-time line and questions for each language in the admin (Projects → your project → Live chat → the English / Български tabs).
Theme, colour and questions
- Theme: light, dark, or auto (follows the visitor's device / your site).
- Colour: the widget uses the project's accent colour, with automatic contrast on the buttons.
- Common questions: add a FAQ that shows on the widget's home screen so easy questions answer themselves, with a "still need help" link into the chat.
- Notifications: add a Slack incoming-webhook to get pinged when a new chat starts.
Configure all of this on the project's Live chat page, then answer conversations from the inbox like any other message.
Keep the newsletter list from your app
A project's newsletter list can be kept by your app as people sign up, register, change their address or delete their account. Three calls do it, with the same X-Project-Key you send with. The list is the key's project; you never name it. Up to 120 calls a minute from one server. How an issue is reviewed and sent is on the Newsletter page.
Add a subscriber
curl https://simpleflare.app/api/newsletter/subscribers \
-H "X-Project-Key: sk_your_project_key" \
-H "Content-Type: application/json" \
-d '{"email": "ann@example.com", "name": "Ann", "locale": "en", "basis": "form", "ip": "203.0.113.7"}'
| Field | What it is |
|---|---|
email | Required. |
basis | Required. form for someone who signed up on your site, customer for someone with an account in your product. |
name | Optional, used in the greeting. |
locale | Optional, en or bg: the language of the confirmation and of the footer we add to each issue. Without it, the brand's language. |
ip | Optional, the visitor's address for a form sign-up, kept as the record of consent. |
form: the person gets a confirmation from your brand and stayspendinguntil they click it. Asking again the same day sends no second confirmation.customer: added assubscribedat once. Someone who already unsubscribed stays out.
{"ok": true, "status": "pending", "inbox": {"name": "Gmail", "url": "https://mail.google.com/..."}}
inbox is there for a form sign-up at one of the big mailbox providers, so your page can offer an "Open Gmail" button; otherwise it is null. A form address that would never get the confirmation is refused with 422 and written nowhere, so your form can ask again:
{"ok": false, "error": "likely_typo", "message": "Did you mean ann@gmail.com?", "did_you_mean": "ann@gmail.com"}
error | Why |
|---|---|
likely_typo | The domain looks mistyped (gmial.com); did_you_mean holds the likely address. |
disposable | A throwaway inbox. |
domain_cannot_receive | The domain has no mail server. |
address_bounced | Mail to this address came back undelivered recently, at any brand. |
A customer address is never refused this way: your product already writes to it.
A deleted account
POST https://simpleflare.app/api/newsletter/subscribers/forget
{"email": "ann@example.com"}
{"ok": true, "removed": true}
Nothing of the person stays on the list. removed is false when the address was not on it.
A changed address
POST https://simpleflare.app/api/newsletter/subscribers/email-changed
{"old": "ann@example.com", "new": "ann@newmail.com"}
{"ok": true, "found": true}
The subscriber keeps their status under the new address. When the new address is already on the list, that entry stays and the old one goes. found is false when the old address was not on the list.
A wrong or missing key answers 401 with {"ok": false, "error": "invalid key"}. Leaving needs no call from you: every issue carries an unsubscribe link and a one-click List-Unsubscribe header.
Lifecycle email from your app's events
Your app tells us what a person did, one person per call, and the brand's automations send them the letters laid out under Newsletter, Automations: right away, after a wait, or only if something else happened. Each letter is one of the brand's templates, filled in with the event's data. Same X-Project-Key; the brand is the key's. Up to 300 calls a minute per key.
curl https://simpleflare.app/api/events \
-H "X-Project-Key: sk_your_project_key" \
-H "Content-Type: application/json" \
-d '{"event": "device.activated", "email": "emma@example.com", "data": {"device_name": "Golf 7"}, "id": "evt_8f2c1"}'
| Field | What it is |
|---|---|
event | Required. Letters, digits and . _ : -, up to 64, for example device.activated. |
email | Required. The person it is about. |
data | Optional, an object of up to 8 KB. A template reads it as {{ event.device_name }}. |
id | Optional, your own id for the event, up to 100 characters. The same id twice is one event: a retried call starts nothing again. |
{"ok": true, "id": 4821, "duplicate": false, "entered": 1}
201 for a new event, 200 with "duplicate": true for an id seen before. entered is how many automations the person started. Every event is kept with the person, on their contact page, for a year.
- Only people on the list. Someone enters only if they are on the brand's list and may be mailed: add a customer first with
basis: customer. An automation can be for customers only or for everyone on the list. A person goes through each automation once. - The newsletter's rails. Every letter is read for phishing and spam like an issue, counts toward the month's block, waits for a new account's daily cap, goes through Amazon SES under the account's tenant, and carries an unsubscribe link and a one-click
List-Unsubscribeheader. At most 2 of these letters reach one person a day. - Leaving ends it. Unsubscribing, a bounce or a spam report takes the person out of every automation. An automation whose letters bounce or are reported past an issue's limits turns itself off.
A wrong or missing key answers 401, a malformed event 422, too many calls 429.
Templates
Templates are per-project and editable in the admin, with a live preview, test sends, and versioning. Each has a subject, an HTML body, and a plain-text fallback, and uses {{var}} placeholders. System templates such as welcome and notify fall back to built-in defaults until you save your own.
To carry over an existing email: open the project's templates, create a new key, paste your HTML, swap dynamic values for {{var}} placeholders, preview, and save. Your product then references it by key through the API.
Deliverability
- Tracking: opens, clicks, and bounces are recorded per message.
- Suppression: permanent (hard) bounces are added to a suppression list automatically, so you stop mailing addresses that will never deliver.
- Unsubscribe: one-click
List-Unsubscribeheaders are supported. - A/B: template variants let you compare subject lines and content.
- Content check: templates and newsletter issues are read for phishing and spam when saved, and every letter through this API is checked before it goes: a link whose text names one site but goes to another, links to a bare IP address or a disguised domain, a form asking for input. A hit holds the account's sending until a person has looked, so we never block ordinary mail by guesswork.
For the most critical transactional mail, such as magic links and password resets, keep a generally-available provider as a fallback until any beta transport you use reaches general availability.
Responses and errors
A successful send returns 200 with {"ok":true}. Errors return a matching status code and an error message.
| Status | Meaning |
|---|---|
| 200 | Sent. Body is {"ok":true}. |
| 401 | Missing or invalid X-Project-Key. |
| 402 | Trial ended. Pick a plan to resume sending. |
| 403 | Transactional email is not part of the current plan, or the account cannot send yet: it is waiting for us to let it in, or its sending is held while we review its content. The error says which. |
| 422 | Validation failed, for example no valid recipient or a body that could not render. Also the letter that put the account on hold for review: it is kept, and can be sent again once we have looked. |
| 429 | Rate limited, or the send allowance or a new account's daily cap stopped this call. See below. |
Send allowance
Each plan includes a block of outbound emails per month. Sends through this API, the letters of newsletter issues and lifecycle letters count. Replies from the inbox and live chat are free and are never counted against it.
| Account | What happens |
|---|---|
| On a paid plan | Past the included block, sends keep going out and the extra is metered per 1,000 at your plan's published rate. A hard ceiling of 3x the included block stops runaway usage, and returns 429. |
| On trial | Sending stops at the included block with 429, because there is no payment method to meter against. Choose a plan to continue. |
| Lapsed or canceled | Sending is paused with 402 until a plan is active again. |
| New, in its first 45 days | A daily cap on top of the above: 200 emails a day in the first week from the day we let the account in, twice as many each week after, none from day 46. Past it the call returns 429 and the error says when sending opens again, at 00:00 UTC. A newsletter issue goes out up to the cap and the rest follows the next day by itself. The schedule is on the pricing page. |
We email the account owner once at 80% and once at 100% of the included block each month, so usage never surprises you. One recipient equals one send, so a message addressed to three people counts as three.
Ready to build? SimpleFlare is not open for signup yet, so ask for early access and tell us what you send. We are letting people in a few at a time.