Skip to content

Deliverability

Transactional email API: keys, streams, first send

Set up the Inspiremail transactional email API: create a scoped API key, a stream with a verified sender, and send your first receipt with safe retries.

· 5 min read · By

Transactional email API: keys, streams, first send

TL;DR: create an API key under Settings › API keys with the messages:send scope, create a stream under Transactional › Streams with a verified sender identity, then call POST https://platform.inspiremail.io/v1/messages with Authorization: Bearer im_live_…, a from address on the stream's identity, a to, a subject and HTML or text. Add an Idempotency-Key header so retries never send twice. Every message gets a timeline in the log, and events can go to your own webhook.

Transactional email is mail a person triggers and expects, such as a receipt or a password reset. An idempotency key is a value you send with a request so that repeating the same request never repeats its effect.

Transactional email is the mail people expect: receipts, password resets, booking confirmations. It should never be held up by a marketing unsubscribe, and it should never go out twice because your server retried. Streams handle the first, idempotency keys the second.

Step 1: create a scoped key

Inspiremail Settings › API keys with the Create API key dialog open: a Name field, a grid of scopes such as lists:read, contacts:write, messages:send described as Send transactional messages (POST /v1/messages), messages:read, hooks:write, journeys:write, and an Expires select set to Never

Settings › API keys. Each scope has a one-line description; tick only what the application needs.

  1. Open Settings › API keys and click Create key. Only the owner and Organization Managers can manage keys.
  2. Name it after the application ("Shop – order emails") so you know what breaks if you revoke it.
  3. Tick messages:send, plus messages:read if the app reads the log.
  4. Choose an expiry, or Never for a long-lived server key.
  5. Click Create key and copy the key straight into your secret manager. It starts with im_live_ and is shown once; only a hash is stored.

The list shows each key's prefix, scopes, last use and expiry. Revoking a key also disables any REST hooks it created.

Step 2: create a stream

New stream dialog on the Transactional page with Name, Slug used as the API stream value, Kind set to Transactional (only hard bounces and complaints block) or Marketing (every suppression blocks, List-Unsubscribe added), a Sender (verified identity) select, an optional default From name, and options to respect marketing unsubscribes, respect the blocklist, track opens and track clicks by default

The New stream dialog. The slug is the value you pass as "stream" in API calls.

  1. Open Transactional › Streams and click New stream.
  2. Give it a Name and a Slug (for example receipts).
  3. Kind: Transactional for receipts and resets, Marketing for product news you send through the API.
  4. Sender: one verified identity of any connected provider. API calls must use this address, or any address at that domain, as from.
  5. Leave Respect the blocklist on. Turn on Respect marketing unsubscribes only if the stream carries mail people can reasonably opt out of.
  6. Tracking is off by default. Turn on opens or clicks if you need them; they run on the sender's tracking domain.

Step 3: send the first message

curl https://platform.inspiremail.io/v1/messages \
  -H "Authorization: Bearer $INSPIREMAIL_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-10482-receipt" \
  -d '{
    "stream": "receipts",
    "from": "Atlas Shop <orders@news.example.com>",
    "to": { "email": "customer@example.net", "name": "Dana Reyes" },
    "subject": "Your order 10482",
    "html": "<p>Thanks, {{first_name}}. Your order is on its way.</p>",
    "variables": { "first_name": "Dana" }
  }'

Addresses are either a string ("Name <address>") or an object with email and name. A 201 means the provider accepted the message. The response carries the message ID; keep it if you want to look the message up later. You can also send a saved template with template_id and variables instead of inline HTML; variables are HTML-escaped. Other fields: reply_to (up to 5), custom headers (up to 20), tags, metadata, attachments and a tracking override.

Diagram of a transactional message: POST /v1/messages with a messages:send key and optional Idempotency-Key, stream checks on the From address and suppressed recipients, sending through the stream's provider account, then the 90-day log and message webhooksFour checkpoints between your call and the inbox.

Responses worth handling

StatusMeaningWhat to do
201Sent: the provider accepted itStore the message ID
200 + Idempotent-ReplayedSame key and body as an earlier callNothing; it wasn't sent again
409Same Idempotency-Key, different bodyUse a new key for a new message
422Recipient suppressed, from not on the stream identity, or attachments the provider can't takeFix the request; don't retry blindly
429Over the per-key limitWait for Retry-After
502The provider refused the messageLogged as failed; check the detail

A suppressed recipient is logged with the status suppressed, so support can see why a customer didn't get their receipt.

Transactional or marketing stream?

Transactional streamMarketing stream
Typical mailReceipts, password resets, alertsProduct news, announcements sent from your app
Refused recipientsHard bounces and complaints, plus your blocklist unless you turn it offEvery suppression, including marketing unsubscribes
List-Unsubscribe headerNot addedAdded automatically (a custom one is refused)
Opens and clicksOff by defaultOff by default, switch on per stream or per call

The rule of thumb: if the recipient would be annoyed not to get it, it's transactional. If they could reasonably say "stop sending me these", it's marketing, and it should respect their unsubscribe. Mixing the two on one stream is how a password reset ends up blocked by a newsletter opt-out, or a promotion slips past one.

Recipient addresses in the log are masked and stored encrypted, so people looking at the Messages tab see enough to identify a message without the full address. Messages are kept for 90 days.

Watch what happens next

The Messages tab on the Transactional page lists every message with its status and a timeline of events. The same log is available through GET /v1/messages (filter by status, recipient, stream or date) and GET /v1/messages/{id}. To react in real time, subscribe an endpoint to message.delivered, message.bounced, message.complained and the other message.* events; the webhooks guide covers signatures and retries.

Why this is quick to adopt

You reuse the providers, verified identities and tracking domains you already set up for drops. There's no separate account to warm up and no second suppression list to keep in sync. The API description is published as OpenAPI 3.1 under Settings › API docs, so you can generate a client instead of writing one, and the OpenAPI specification tells your tooling how to read it.

How we checked this guide

We tested each step in a demo organization with fictitious data on 22 November 2026 and compared it with the provider documentation linked above, and with FIPS 198-1, the HMAC standard for the background on API security. Screens, button labels, limits and error messages are taken from the product as it works today. If something here no longer matches what you see, contact us and we'll correct it, as our editorial policy describes. Read more about us.

Webhooks for events, Postmark if you send through a Postmark transactional stream, and the API & webhooks and developers pages. Background on the headers: the IETF's draft Idempotency-Key header and RFC 6585 for status 429.

Frequently asked questions

Which API key scope do I need to send transactional email?

messages:send to call POST /v1/messages, and messages:read if your code also reads the message log. Give each application its own key with only those scopes.

What is a stream?

A stream groups messages with one sender and one suppression policy. A transactional stream only refuses hard bounces, complaints and, by default, your blocklist. A marketing stream refuses every suppression and adds List-Unsubscribe headers.

How do I retry a send safely?

Send an Idempotency-Key header. For 24 hours, the same key with the same body returns the original response instead of sending again, and the same key with a different body is refused with HTTP 409.

What are the API limits?

600 requests per minute per key across the API, and 300 messages per minute per key on POST /v1/messages. Over the limit the API answers 429 with a Retry-After header.

How long are transactional messages kept?

90 days, with the recipient address masked and stored encrypted. Each message keeps its event timeline: sent, delivered, delayed, bounced, complained, opened and clicked.

Can I attach files?

Yes: up to 10 files, 5 MB each and 10 MB in total, sent base64-encoded. Executable files are refused.

  • transactional email API
  • api keys
  • idempotency
  • receipts
  • developers

Product updates and deliverability notes

One email when something worth knowing ships — new features, provider changes and bulk-sender rule updates. No spam, unsubscribe anytime.

Ready to run your next drop on Inspiremail?

Tell us about your volume, providers and networks — or apply directly and pick your plan during onboarding.

Already a customer? Sign in