Send emails from your app
One API call sends an email. Copy the code, or run it right here on this page.
https://envoi-orcin.vercel.appDon't write code? Send from the dashboard instead.
Send your first email
Three steps.
Open Domains, type your domain (for example mail.yourbusiness.com) and paste the one line it shows into your domain settings. We check it automatically.
Open API keys and click Create. Copy the key straight away: it's only shown once.
Click ▶ Try it on the right, paste your key, put your domain in from and your own email in to, then click Run. Check your inbox!
curl -X POST 'https://envoi-orcin.vercel.app/emails' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"from": "Your name <hello@yourdomain.com>",
"to": [
"you@example.com"
],
"subject": "Hello from Sendezy",
"html": "<p>It works!</p>"
}'What do you want to do?
Pick a task to jump straight to it.
New to APIs? Six words to know
A way for your website or app to talk to Sendezy, by sending it requests.
A secret password for your app. It starts with sz_. Keep it on your server, never in a web page.
Your web address, like yourbusiness.com. Your emails are sent from it.
One instruction to Sendezy, like “send this email”. The code examples are requests.
Sendezy's reply to a request. It tells you whether it worked, and gives you an ID.
The other direction: Sendezy messages your app when something happens, like a bounce.
Emails
Send transactional email such as receipts, sign-up confirmations and password resets, one at a time or in batches.
Send an email
/emailsSends a single email. It's queued and delivered within seconds, or at scheduled_at if you set one.
Extra headers
Idempotency-KeytextMakes retries safe: repeating a request with the same key within 24 hours returns the first response instead of sending again.
What to send
fromtextrequiredSender address on a verified domain. Use "Name <address>" to show a name.
totext or list of textrequiredRecipient address, or up to 50 addresses (to + cc + bcc combined).
subjecttextrequiredEmail subject line.
htmltextHTML body. Provide html, text, or both.
texttextPlain-text body. Generated from html if you leave it out.
cctext or list of textCarbon-copy recipients.
bcctext or list of textBlind carbon-copy recipients.
reply_totext or list of textWhere replies go.
headerskey–value pairsCustom email headers, as key-value strings.
tags{ name, value }[]Up to 50 tags. Returned in webhooks, so you can match events to your records.
attachments{ filename, content?, path?, content_type? }[]Up to 20 files. content is base64; path is an https URL to fetch.
scheduled_attextSend later: an ISO 8601 date or natural language like "in 2 hours". Up to 30 days ahead.
curl -X POST 'https://envoi-orcin.vercel.app/emails' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"from": "Acme <hello@mail.acme.com>",
"to": [
"ada@example.com"
],
"subject": "Welcome to Acme",
"html": "<p>Thanks for signing up!</p>"
}'Send a batch
/emails/batchSends up to 100 different emails in one request. Every email is checked before any is sent, so either all are accepted or none are.
What to send
(body)list of emailsrequiredAn array of 1–100 email objects with the same fields as Send an email, except attachments and scheduled_at.
curl -X POST 'https://envoi-orcin.vercel.app/emails/batch' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '[
{
"from": "Acme <hello@mail.acme.com>",
"to": [
"ada@example.com"
],
"subject": "Your receipt",
"html": "<p>Order #1001</p>"
},
{
"from": "Acme <hello@mail.acme.com>",
"to": [
"grace@example.com"
],
"subject": "Your receipt",
"html": "<p>Order #1002</p>"
}
]'Retrieve an email
/emails/:idReturns one email, including its latest status in last_event.
In the address
idtextrequiredThe email ID returned when you sent it.
last_event is one of: queued, scheduled, sending, sent, delivered, delivery_delayed, opened, clicked, bounced, complained, failed, suppressed, canceled.curl -X GET 'https://envoi-orcin.vercel.app/emails/4ef9a417-02e9-4d39-ad75-9611e0fa0c40' \
-H 'Authorization: Bearer sz_123456789'List emails
/emailsReturns your most recent emails, newest first.
Options
limitnumberHow many to return, 1–100. Default 20.
curl -X GET 'https://envoi-orcin.vercel.app/emails?limit=20' \
-H 'Authorization: Bearer sz_123456789'Reschedule an email
/emails/:idChanges when a scheduled email goes out. Only works while the email is still scheduled.
In the address
idtextrequiredThe email ID.
What to send
scheduled_attextrequiredNew send time: ISO 8601 or "in 1 hour". A time in the past sends it now.
curl -X PATCH 'https://envoi-orcin.vercel.app/emails/4ef9a417-02e9-4d39-ad75-9611e0fa0c40' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"scheduled_at": "2026-11-21T09:00:00Z"
}'Cancel a scheduled email
/emails/:id/cancelStops a scheduled email from being sent.
In the address
idtextrequiredThe email ID.
curl -X POST 'https://envoi-orcin.vercel.app/emails/4ef9a417-02e9-4d39-ad75-9611e0fa0c40/cancel' \
-H 'Authorization: Bearer sz_123456789'Domains
You can only send from domains you've verified. Adding a domain gives you one record to copy into your domain's DNS settings (plus one recommended).
Add a domain
/domainsAdds a sending domain and returns its DNS records. We recommend a subdomain such as mail.yourcompany.com.
What to send
nametextrequiredThe domain to send from.
curl -X POST 'https://envoi-orcin.vercel.app/domains' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"name": "mail.acme.com"
}'Verify a domain
/domains/:id/verifyChecks the DNS records now. DNS changes can take a few minutes, sometimes a few hours, to appear.
In the address
idtextrequiredThe domain ID.
curl -X POST 'https://envoi-orcin.vercel.app/domains/d91cd9bd-1176-453e-8fc1-35364d380206/verify' \
-H 'Authorization: Bearer sz_123456789'Retrieve a domain
/domains/:idReturns one domain with its records and their status.
In the address
idtextrequiredThe domain ID.
curl -X GET 'https://envoi-orcin.vercel.app/domains/d91cd9bd-1176-453e-8fc1-35364d380206' \
-H 'Authorization: Bearer sz_123456789'curl -X GET 'https://envoi-orcin.vercel.app/domains' \
-H 'Authorization: Bearer sz_123456789'Update tracking
/domains/:idTurns open and click tracking on or off for emails sent from this domain.
In the address
idtextrequiredThe domain ID.
What to send
open_trackingtrue or falseRecord when people open your emails.
click_trackingtrue or falseRecord when people click links in your emails.
curl -X PATCH 'https://envoi-orcin.vercel.app/domains/d91cd9bd-1176-453e-8fc1-35364d380206' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"open_tracking": true,
"click_tracking": true
}'Delete a domain
/domains/:idRemoves the domain. You can no longer send from it.
In the address
idtextrequiredThe domain ID.
curl -X DELETE 'https://envoi-orcin.vercel.app/domains/d91cd9bd-1176-453e-8fc1-35364d380206' \
-H 'Authorization: Bearer sz_123456789'Contact lists
Contact lists (called audiences in the API) hold the people you send campaigns to. Add contacts from your app's sign-up flow to keep a list in sync.
Create a list
/audiencesCreates an empty contact list.
What to send
nametextrequiredA name you'll recognise, such as "Newsletter".
curl -X POST 'https://envoi-orcin.vercel.app/audiences' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"name": "Newsletter"
}'curl -X GET 'https://envoi-orcin.vercel.app/audiences' \
-H 'Authorization: Bearer sz_123456789'Delete a list
/audiences/:idDeletes the list and every contact in it.
In the address
idtextrequiredThe list ID.
curl -X DELETE 'https://envoi-orcin.vercel.app/audiences/78261eea-8f8b-4381-83c6-79fa7120f1cf' \
-H 'Authorization: Bearer sz_123456789'Add a contact
/audiences/:id/contactsAdds a contact. If the email is already on the list, the contact is updated instead, so it's safe to call on every sign-up.
In the address
idtextrequiredThe list ID.
What to send
emailtextrequiredThe contact's email address.
first_nametextUsed by {{{FIRST_NAME}}} in campaigns.
last_nametextUsed by {{{LAST_NAME}}}.
unsubscribedtrue or falseSet true to stop campaigns going to this contact.
curl -X POST 'https://envoi-orcin.vercel.app/audiences/78261eea-8f8b-4381-83c6-79fa7120f1cf/contacts' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"email": "ada@example.com",
"first_name": "Ada",
"last_name": "Lovelace"
}'List contacts
/audiences/:id/contactsReturns every contact on the list.
In the address
idtextrequiredThe list ID.
curl -X GET 'https://envoi-orcin.vercel.app/audiences/78261eea-8f8b-4381-83c6-79fa7120f1cf/contacts' \
-H 'Authorization: Bearer sz_123456789'Update a contact
/audiences/:id/contacts/:contactChanges a contact's name or subscription. Find the contact by ID or by email address.
In the address
idtextrequiredThe list ID.
contacttextrequiredThe contact ID, or their email address.
What to send
first_nametextNew first name.
last_nametextNew last name.
unsubscribedtrue or falsetrue to unsubscribe, false to re-subscribe.
curl -X PATCH 'https://envoi-orcin.vercel.app/audiences/78261eea-8f8b-4381-83c6-79fa7120f1cf/contacts/ada@example.com' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"unsubscribed": true
}'Remove a contact
/audiences/:id/contacts/:contactRemoves a contact from the list.
In the address
idtextrequiredThe list ID.
contacttextrequiredThe contact ID, or their email address.
curl -X DELETE 'https://envoi-orcin.vercel.app/audiences/78261eea-8f8b-4381-83c6-79fa7120f1cf/contacts/ada@example.com' \
-H 'Authorization: Bearer sz_123456789'Campaigns
Campaigns (called broadcasts in the API) send one email to everyone on a contact list. Each person gets a personalised copy with their own unsubscribe link.
Create a campaign
/broadcastsCreates a draft campaign. Nothing is sent until you call Send a campaign.
What to send
audience_idtextrequiredThe contact list to send to.
fromtextrequiredSender address on a verified domain.
subjecttextrequiredSubject line. Personalisation variables work here too.
htmltextHTML body. Provide html, text, or both.
texttextPlain-text body.
nametextInternal name, shown only in your dashboard.
reply_totext or list of textWhere replies go.
curl -X POST 'https://envoi-orcin.vercel.app/broadcasts' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"from": "Acme <news@mail.acme.com>",
"subject": "What'\''s new this month",
"html": "<p>Hi {{{FIRST_NAME|there}}}, here'\''s what'\''s new.</p>"
}'Send a campaign
/broadcasts/:id/sendSends a draft campaign now, or schedules it. Unsubscribed and suppressed addresses are skipped automatically.
In the address
idtextrequiredThe campaign ID.
What to send
scheduled_attextOptional. Send later: ISO 8601 or "in 2 hours".
curl -X POST 'https://envoi-orcin.vercel.app/broadcasts/559ac32e-9ef5-46fb-82a1-b76b840c0f7b/send' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"scheduled_at": "in 2 hours"
}'Retrieve a campaign
/broadcasts/:idReturns one campaign with its status and recipient count.
In the address
idtextrequiredThe campaign ID.
curl -X GET 'https://envoi-orcin.vercel.app/broadcasts/559ac32e-9ef5-46fb-82a1-b76b840c0f7b' \
-H 'Authorization: Bearer sz_123456789'curl -X GET 'https://envoi-orcin.vercel.app/broadcasts' \
-H 'Authorization: Bearer sz_123456789'Delete a campaign
/broadcasts/:idDeletes a draft or scheduled campaign. Sent campaigns are kept for your records.
In the address
idtextrequiredThe campaign ID.
curl -X DELETE 'https://envoi-orcin.vercel.app/broadcasts/559ac32e-9ef5-46fb-82a1-b76b840c0f7b' \
-H 'Authorization: Bearer sz_123456789'Webhooks
Webhooks tell your server what happened to each email: delivered, opened, bounced and more. Each request is signed so you can check it came from us.
Create a webhook
/webhooksRegisters an HTTPS endpoint to receive events. The response includes the signing secret, shown only once.
What to send
endpointtextrequiredYour HTTPS URL.
eventslist of textrequiredWhich events to receive. See Event types below.
curl -X POST 'https://envoi-orcin.vercel.app/webhooks' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"endpoint": "https://acme.com/api/email-events",
"events": [
"email.delivered",
"email.bounced",
"email.complained"
]
}'curl -X GET 'https://envoi-orcin.vercel.app/webhooks' \
-H 'Authorization: Bearer sz_123456789'Delete a webhook
/webhooks/:idStops sending events to this endpoint.
In the address
idtextrequiredThe webhook ID.
curl -X DELETE 'https://envoi-orcin.vercel.app/webhooks/4dd369bc-aa82-4ff3-97de-514ae3000ee0' \
-H 'Authorization: Bearer sz_123456789'Help & advanced
Errors, limits and extra features. You don't need these to get started.
Errors
If something goes wrong, the response has a number (the status) and a short message saying what to fix. Here's what each one means:
| Status | Name | What it means |
|---|---|---|
| 401 | missing_api_key | No API key in the Authorization header. |
| 401 | restricted_api_key | A sending-only key tried to call something other than sending. |
| 403 | invalid_api_key | The key doesn't exist or was deleted. |
| 403 | validation_error | The sender's domain isn't verified on your account. |
| 403 | account_suspended | Sending is paused because of high bounce or spam rates. Contact support. |
| 404 | not_found | The ID doesn't exist on your account. |
| 422 | validation_error | A field is missing or invalid. The message says which. |
| 429 | rate_limit_exceeded | More than 10 requests per second with one key. Wait and retry. |
| 429 | daily_quota_exceeded | You've reached your daily sending limit. |
| 429 | monthly_quota_exceeded | You've reached your monthly sending limit. |
| 500 | application_error | Something went wrong on our side. Retry with an Idempotency-Key. |
{
"statusCode": 422,
"name": "validation_error",
"message": "subject: Too small: expected string to have >=1 characters"
}API key types
Every request sends your key in the Authorization header, as shown on the right. The examples on this page already do this.
Full accessCan do everything: send emails and manage domains, contact lists, campaigns and webhooks.
Sending accessCan only send emails, optionally from just one domain. Safer for servers that only send.
Authorization: Bearer sz_123456789Limits & safe retries
Each key can make up to 10 requests per second. If you go over, wait a moment and try again. To send lots of emails, use Send a batch (100 at a time) or a campaign.
If a request times out and you're not sure it worked, add an Idempotency-Key header. Sending the same key again within 24 hours returns the first result instead of sending a second email.
Idempotency-Key: order-1001-receiptWebhook events
When something happens to an email, Sendezy sends your webhook one of these events. Reply with any 2xx status to say you got it.
email.sentWe accepted the email and handed it to the receiving mail server.
email.deliveredThe recipient's mail server accepted it.
email.delivery_delayedDelivery is taking longer than usual; we keep retrying.
email.openedThe recipient opened it (needs open tracking).
email.clickedThe recipient clicked a link (needs click tracking).
email.bouncedThe address doesn't exist or permanently rejected the email. It's added to your suppression list.
email.complainedThe recipient marked it as spam. They're added to your suppression list.
email.failedWe couldn't send it, for example because the domain is no longer verified.
email.scheduledThe email was scheduled for later.
email.suppressedNot sent, because every recipient is on your suppression list.
contact.unsubscribedA contact clicked unsubscribe in a campaign.
{
"type": "email.delivered",
"created_at": "2026-11-20T10:12:55.000Z",
"data": {
"email_id": "4ef9a417-02e9-4d39-ad75-9611e0fa0c40",
"from": "Acme <hello@mail.acme.com>",
"to": [
"ada@example.com"
],
"subject": "Welcome to Acme",
"created_at": "2026-11-20T10:12:53.000Z",
"tags": {
"category": "welcome"
}
}
}Verifying webhooks
Each webhook request is signed, so you can check it really came from Sendezy. Use your webhook's secret (it starts with whsec_) with the free standardwebhooks library, as shown on the right.
The signature headers are webhook-id, webhook-timestamp and webhook-signature (also sent with svix- names).
import { Webhook } from "standardwebhooks";
const wh = new Webhook(process.env.SENDEZY_WEBHOOK_SECRET); // whsec_…
export async function POST(req) {
const body = await req.text();
const event = wh.verify(body, Object.fromEntries(req.headers)); // throws if forged
if (event.type === "email.bounced") {
// e.g. mark the address as invalid in your database
}
return new Response("ok");
}Personalisation
In campaigns, these are replaced for each person. Text after | is used when you don't have that detail.
{{{FIRST_NAME|there}}}Their first name, or “there”.
{{{LAST_NAME}}}Their last name.
{{{EMAIL}}}Their email address.
{{{SENDEZY_UNSUBSCRIBE_URL}}}Their unsubscribe link. If you leave it out, we add one for you.
<p>Hi {{{FIRST_NAME|there}}},</p>
<p>Here's what's new this month.</p>
<a href="{{{SENDEZY_UNSUBSCRIBE_URL}}}">Unsubscribe</a>Scheduling
To send later, add scheduled_at with a date and time, or plain words like in 2 hours. You can schedule up to 30 days ahead, and change or cancel it until it's sent.
"scheduled_at": "2026-11-21T09:00:00Z"
"scheduled_at": "in 2 hours"Switching from Resend
Sendezy works with the official resend library, so your code stays the same:
- Verify your domain in Sendezy.
- Set
RESEND_BASE_URLtohttps://envoi-orcin.vercel.app. - Use your Sendezy
sz_key.
// .env
RESEND_BASE_URL=https://envoi-orcin.vercel.app
SENDEZY_API_KEY=sz_123456789
// your code stays the same
import { Resend } from "resend";
const resend = new Resend(process.env.SENDEZY_API_KEY);
const { data, error } = await resend.emails.send({
from: "Acme <hello@mail.acme.com>",
to: ["ada@example.com"],
subject: "Welcome to Acme",
html: "<p>Thanks for signing up!</p>",
});Create an API key
/api-keysCreates a key. The token is shown only in this response, so store it somewhere safe.
What to send
nametextrequiredA label, such as "Production server".
permission"full_access" or "sending_access"Default full_access. sending_access can only send emails.
domain_idtextOptional, for sending_access keys: only allow sending from this domain.
curl -X POST 'https://envoi-orcin.vercel.app/api-keys' \
-H 'Authorization: Bearer sz_123456789' \
-H 'Content-Type: application/json' \
-d '{
"name": "Production server",
"permission": "sending_access"
}'curl -X GET 'https://envoi-orcin.vercel.app/api-keys' \
-H 'Authorization: Bearer sz_123456789'Delete an API key
/api-keys/:idRevokes the key immediately.
In the address
idtextrequiredThe key ID.
curl -X DELETE 'https://envoi-orcin.vercel.app/api-keys/dacf4072-4119-4d88-932f-6202748ac7c8' \
-H 'Authorization: Bearer sz_123456789'