Quickstart: send your first email
This guide takes you from a fresh SendBunny install to a delivered transactional email. Every step is explicit — no context is assumed beyond the prerequisites listed below.
Prerequisites
- A SendBunny install in your AWS account. SendBunny is self-hosted: there is no shared SaaS endpoint. If you have not installed it yet, see Deploy — installation is a pre-filled CloudFormation template and takes about 10 minutes.
- Admin access to your SendBunny dashboard. The install emails the first admin a temporary password. API keys can only be created by users in the ADMIN role.
- A verified sender domain. In the dashboard, open your domain's onboarding page and complete DNS setup (DKIM/SPF/DMARC records). The API refuses to send from unverified addresses with HTTP 403.
- SES production access (for real recipients). New AWS accounts start in the SES sandbox, which only delivers to verified recipient addresses. The dashboard includes a wizard for requesting production access. In the sandbox, sends to unverified recipients fail with HTTP 502.
Step 1 — Create an API key
- In your SendBunny dashboard, go to API Keys (left sidebar).
- Click New key, name it, and select the sending domain(s) the key may use. A key can only send from the root domains it was issued for.
- Copy the key immediately. It starts with
sb_and is shown exactly once — SendBunny stores only a hash. If you lose it, revoke it and create a new one.
Step 2 — Copy your API URL
Because SendBunny runs in your own AWS account, your API endpoint is unique to your install. The same API Keys page in the dashboard shows your Transactional API URL — an AWS Lambda function URL that looks like https://abc123xyz.lambda-url.us-east-1.on.aws/. All requests are a POST to that URL.
Step 3 — Send an email
Replace the URL, the key, and from (must be an address on a domain you verified — see prerequisites — and allowed for this key in Step 1). In the SES sandbox, to must be a verified recipient or an SES mailbox simulator address like success@simulator.amazonses.com.
curl -X POST 'https://YOUR-INSTALL.lambda-url.us-east-1.on.aws/' \
-H 'Authorization: Bearer sb_YOUR_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"from": "hello@yourdomain.com",
"to": "success@simulator.amazonses.com",
"subject": "Hello from SendBunny",
"html": "<p>It works!</p>"
}'A successful send returns HTTP 200 with the SES message id:
{ "messageId": "0100018f2ab4c123-..." }Troubleshooting
| Status | Error | Fix |
|---|---|---|
| 401 | Unauthorized / Invalid API key | Send the key as Authorization: Bearer sb_.... Check the key was not revoked. |
| 403 | This API key is not allowed to send from that domain | The from domain is not in this key's allowed domains. The response lists allowedRootDomains; use one of those or issue a new key. |
| 403 | From address is not a verified sender identity | Complete domain verification in the dashboard for the from domain (DNS records must be live). |
| 400 | 'subject' is required and similar | Field validation failed — the error message names the exact field. See the API reference for the full request contract. |
| 422 | Recipient is on the suppression list | The recipient previously bounced, complained, or was manually suppressed. Remove them in dashboard → Suppression only if you are certain the address is deliverable. |
| 502 | SES error message | SES rejected the send — most often sandbox mode (unverified recipient) or sending-quota limits. The message is passed through from SES. |
Next steps
- Full API reference — every field, every error, rate behavior.
- Email templates — store templates in the dashboard, send with
templateAlias+datamerge variables instead of inline HTML. - OpenAPI spec — machine-readable contract for codegen and AI agents.