Email API
Send transactional email from EU infrastructure with a single API call. Official TypeScript, Python, and Go SDKs, plus REST examples for every major language.
One POST request
Send an email with a single HTTPS call. Official SDKs for TypeScript, Python, and Go, with REST examples for Ruby, PHP, Java, and curl.
EU-hosted infrastructure
Hetzner data centre in Helsinki, Finland, operated by a Danish company. GDPR compliant and not subject to the US CLOUD Act.
Real-time tracking
Opens, clicks, bounces, and complaints are recorded in real time. Every event is available in the dashboard and via signed webhooks.
Send an email
import { PostStack } from '@poststack.dev/sdk';
const poststack = new PostStack('sk_live_...');
await poststack.emails.send({
from: 'hello@yourdomain.com',
to: ['user@example.com'],
subject: 'Welcome aboard!',
html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
});Use cases
Transactional sends
Welcome flows, password resets, magic links, order confirmations, receipts, invoices, and 2FA codes. Single-recipient, low-latency, high-deliverability email triggered from your application code in response to a user action.
Notifications and alerts
System alerts, weekly digests, scheduled reports, and account warnings. Compose templates once, fan them out per recipient with merge variables, and rely on automatic retries when downstream MTAs hiccup.
AI agents and MCP-driven workflows
PostStack ships a Model Context Protocol server, so Claude, Cursor, and other AI assistants can send email on a user’s behalf with scoped OAuth access and an audit log of every action — and the same suppression list protects agent sends as API sends.
Replacing Resend or SendGrid
A near-identical REST shape with up to 71% lower cost at the entry tier, EU data residency by default, and IMAP mailboxes on the same domain. The same SDK ergonomics, without the CLOUD Act exposure.
How it works
The PostStack email API is a REST endpoint over HTTPS that accepts a JSON payload describing the message — from, to, subject, html, and optional text, cc, bcc, reply_to, headers, attachments, tags, and tracking flags. Every request authenticates with a Bearer token using your `sk_live_` API key. We sign every outbound message with DKIM keys we provision automatically when you add a domain, and check SPF and DKIM before the domain is allowed to send. Idempotency keys (sent via the `Idempotency-Key` header) make retries safe: repeating a key returns the original email instead of sending a second copy, for as long as that email is within your log retention. The API accepts the message and queues it; SMTP delivery is dispatched within seconds, and transient failures (greylisting, a busy or temporarily full receiving server) are retried with backoff for up to three days before the message is reported as bounced. Every send creates an event stream — `email.sent`, `email.delivered`, `email.delivery_delayed`, `email.bounced`, `email.opened`, `email.clicked`, `email.complained`, `email.unsubscribed` — that you can read per message via the API (`GET /emails/:id/events`), subscribe to via webhook, or browse in the dashboard. Suppressions (hard bounces and unsubscribes) are enforced automatically and exposed via the API so you can mirror them into your own systems.
Full parameters, limits, and examples are in the Email API documentation.
Frequently asked questions
How is the PostStack email API different from Resend or SendGrid?
The wire format is similar (POST JSON, Bearer auth), but PostStack is operated by a Danish company, hosted in a Hetzner data centre in Finland, and not subject to the US CLOUD Act. Pricing is up to 71% lower at common volumes, and the same domain can host IMAP mailboxes alongside the API without a second provider.
Where does my email data live?
All processing, queuing, sending, and event storage runs inside the European Union (Finland). PostStack does not replicate, mirror, or copy email content outside the EU. Backups, logs, and metrics are EU-only.
Do you have SDKs?
Yes — official SDKs for TypeScript/JavaScript, Python (sync and async), and Go. Every SDK is MIT-licensed, open-source on GitHub, and matches the REST API one-to-one. We publish typed clients with auto-completion, retries, and structured error handling.
What about rate limits?
Limits are set per endpoint and counted per API key: 60 single sends per minute on `POST /emails`, and 10 batch requests per minute on `POST /emails/batch` (up to 100 emails each). Free accounts run at half rate; every paid plan gets the full rate. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset`, and a 429 includes `Retry-After`. Need more for a launch or migration? Contact support and we can raise your limit without a plan change.
How do I migrate from another provider?
Most teams switch in under an hour. Point your DNS to PostStack DKIM/SPF records, swap the SDK or HTTP client, and (optionally) import your suppression list via the API. We have dedicated migration guides for Resend, SendGrid, and Postmark.
What is the free tier?
3,000 emails per month, free forever, no credit card. The free tier includes full API access, the dashboard, open and click tracking, webhooks, and one verified domain (external recipients are capped at 50 per day as an abuse guard). Paid plans start at €5/month for 10,000 emails.