Call POST /v1/send from an App Router route handler, send one email, and find it in your send log. No package to install.
Create a free account and sendvia issues a key immediately: 250 emails a day on 1 domain, enough to work through this guide. Find it on the Account page, prefixed sv_live_. Keep it server-side, in .env.local, never in a client component:
SENDVIA_API_KEY=sv_live_xxxxxxxxxxxxxxxxxxxxxxxx
You also need a domain verified in your account, since the call below sends from an address on it. Add one under Domains if you have not already, and give its DNS records time to propagate.
sendvia has no Next.js SDK, so this is a Route Handler that calls the REST API server-side, which keeps the key out of the browser entirely.
// app/api/send/route.ts
export async function POST() {
const response = await fetch('https://api.sendvia.io/v1/send', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SENDVIA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
from: '[email protected]',
to: '[email protected]',
subject: 'Hello from sendvia',
html: '<p>This is a test email sent through sendvia.</p>',
}),
});
const data = await response.json();
return Response.json(data, { status: response.status });
}
from, to and subject are required, along with at least one of html or text. Do not put an @sendvia.io address in from: sendvia matches the sending domain against the domains verified on your own account, and sendvia.io is never on that list for you, so the request fails before it reaches Amazon. Call the route from a client component, a server action, or curl while you are testing it:
curl -X POST http://localhost:3000/api/send
{"success":true,"message_id":"0102018f1234abcd-...","log_id":42}
log_id identifies this email's row in your account's send log, which the next step reads back.
Every send ends up in the same place no matter how it was sent: the dashboard's History page, or the API directly.
curl "https://api.sendvia.io/v1/[email protected]" \
-H "Authorization: Bearer sv_live_xxxxxxxxxxxxxxxxxxxxxxxx"
{
"total": 1,
"limit": 25,
"offset": 0,
"logs": [
{
"id": 42,
"to_address": "[email protected]",
"from_address": "[email protected]",
"subject": "Hello from sendvia",
"status": "delivered",
"error_message": null,
"sent_at": "2026-08-20 10:03:01",
"delivered_at": "2026-08-20 10:05:01"
}
]
}
The status reads sent as soon as the route handler above resolves. sendvia never receives a delivery confirmation from the recipient's mail server: two minutes after a clean send it marks the message delivered on its own, an inference from the absence of a bounce rather than a receipt. A real bounce or failure overwrites that status the moment one arrives; nothing plays the same role for a genuine delivery. Free-plan logs keep for 7 to 90 days, longer on premium.
A new SES account starts inside Amazon's sandbox: 200 emails a day, sent only to recipient addresses you have verified yourself in the SES console, pending an AWS review that usually takes 12 to 24 hours. Send to any other address while sandboxed and the route handler above returns whatever status response.status carried through, a 502, with AWS's own rejection reason in the body:
{"error":"SES send failed: ...","log_id":42}
Verify the test recipient in the SES console while you wait, or request production access, which lifts the restriction for every recipient at once.
Before sendvia ever calls AWS, it checks the domain on your from address against the domains verified on your account. A domain you have not added yet, or one still waiting on its DNS, fails that check straight away:
{"error":"The domain \"yourdomain.com\" has not been verified. Add and verify it in the dashboard first."}
Add the domain under Domains, publish the records sendvia generates, and the same route goes through once the check passes.
| Symptom | Cause | Fix |
|---|---|---|
HTTP 502, SES send failed: ... | SES sandbox: the recipient is not verified | Verify the recipient in SES, or request production access |
| HTTP 422, domain not verified | The from domain is not verified on your account | Add and verify the domain under Domains |