Documentation
Send email, and see exactly what happened to it.
Posthaste delivers your mail directly to the recipient’s server from infrastructure we run ourselves, and keeps the entire SMTP conversation so you can read it back. This reference covers every endpoint, every error type and every event we will send you.
Quickstart
Three things stand between you and a delivered email: a key, one DNS record, and one request.
- Create an API key. Keys are created in the dashboard by a signed-in owner or admin whose email address has been confirmed. The key is shown once. How to get one →
- Verify a sending domain. Add the domain, publish the single DKIM record it returns, then run verification. Sending from an unverified domain is refused outright. Domain setup →
- Send. One request, one recipient. There is an official SDK for TypeScript, Python and Go; anywhere else, it is one HTTPS request and there is nothing to install.
// npm i @posthaste/sdk
import { Posthaste } from '@posthaste/sdk'
const posthaste = new Posthaste({ apiKey: process.env.POSTHASTE_KEY })
const { id, status } = await posthaste.emails.send({
from: '[email protected]',
to: '[email protected]',
subject: 'Reset your password',
text: 'Click the link to reset your password.',
})
// msg_AZLm3kQ8T2Sf9pXbNc7HrQ 'queued'202 Accepted means the message is durably stored and queued — not that it has been delivered. The message row, its content, its delivery job and its first event are committed in one transaction, so a crash cannot lose a message you were told we had.
To find out what happened next, read the message record or subscribe to webhooks.
The reference
The base URL is https://api.posthastemail.dev and every request carries an API key as a bearer token. Start with Conventions if you would rather see the shape of the API before any one endpoint.
Getting started
Sending
Receiving
Reference
Limits, at a glance
Four different limits can return 429, and they mean different things. If you arrived here from an error message, this is the one you want.
- Your account’s daily sending cap starts at 50 messages and rises as your sending history builds — good days move it up a step, bad ones move it down. Error type
daily_limit_reached. How the cap moves → - Your plan’s monthly allowance is a fixed number of accepted messages per calendar month in UTC. Error type
monthly_limit_reached, with aRetry-Afterpointing at the start of next month. Moving to a larger plan lifts it immediately. - The platform’s own daily ceiling is ours rather than yours: a cap on what everyone on the shared sending IP sends in a day, because that total is the number receivers judge. Error type
platform_paused, with a shortRetry-After. Nothing is wrong with your account. Why it exists → - The request rate limit is 1,200 requests per 60 seconds, counted per API key — unrelated to how much mail you may send. Error type
rate_limited. Rate limits →
You never have to wait for a 429 to find out where you stand. GET /v1/me returns the cap, what you have sent today and what is left.
NextAuthentication →How to get an API key, what the scopes allow, and why there is no test environment.