Emails API
Send transactional emails, track delivery status, and generate shareable preview links. Emails are scoped to the authenticated user's customer account. Public preview endpoints allow viewing emails via secure tokens without authentication.
Base path: /api/v2/emails
Email Management
List, retrieve, send, and delete emails. All management endpoints require JWT authentication.
/api/v2/emailsAuthenticatedList emails for the authenticated user's customer account. Supports filtering by workspace, status, and search.
Query Parameters
limitintegerMaximum emails to return. Defaults to 50.
offsetintegerNumber of emails to skip for pagination.
workspace_idstringFilter by workspace UUID.
statusstringFilter by delivery status.
searchstringSearch by subject or recipient email.
Request
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails?limit=25&search=invoice" \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"data": [
{
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"em_abc123",
400">class="text-emerald-400">"resend_id": 400">class="text-emerald-400">"re_xyz789",
400">class="text-emerald-400">"from_email": 400">class="text-emerald-400">"noreply@lvng.ai",
400">class="text-emerald-400">"to_emails": [400">class="text-emerald-400">"user@company.com"],
400">class="text-emerald-400">"subject": 400">class="text-emerald-400">"Your monthly invoice",
400">class="text-emerald-400">"status": 400">class="text-emerald-400">"delivered",
400">class="text-emerald-400">"sent_at": 400">class="text-emerald-400">"2026-04-01T10:00:00.000Z",
400">class="text-emerald-400">"sent_via": 400">class="text-emerald-400">"webapp",
400">class="text-emerald-400">"public_token": 400">class="text-emerald-400">"tok_abc123",
400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-04-01T10:00:00.000Z",
400">class="text-emerald-400">"view_url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//app.lvng.ai/emails/tok_abc123"
}
],
400">class="text-emerald-400">"pagination": {
400">class="text-emerald-400">"limit": 25,
400">class="text-emerald-400">"offset": 0,
400">class="text-emerald-400">"total": 1
}
}/api/v2/emails/:idAuthenticatedGet full email details including HTML content and metadata.
Path Parameters
idstringrequiredUUID of the email.
Request
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails/em_abc123 \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"data": {
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"em_abc123",
400">class="text-emerald-400">"resend_id": 400">class="text-emerald-400">"re_xyz789",
400">class="text-emerald-400">"from_email": 400">class="text-emerald-400">"noreply@lvng.ai",
400">class="text-emerald-400">"to_emails": [400">class="text-emerald-400">"user@company.com"],
400">class="text-emerald-400">"cc_emails": [],
400">class="text-emerald-400">"subject": 400">class="text-emerald-400">"Your monthly invoice",
400">class="text-emerald-400">"html_content": 400">class="text-emerald-400">"<html>...</html>",
400">class="text-emerald-400">"text_content": 400">class="text-emerald-400">"Your invoice for March 2026...",
400">class="text-emerald-400">"status": 400">class="text-emerald-400">"delivered",
400">class="text-emerald-400">"sent_at": 400">class="text-emerald-400">"2026-04-01T10:00:00.000Z",
400">class="text-emerald-400">"sent_via": 400">class="text-emerald-400">"webapp",
400">class="text-emerald-400">"public_token": 400">class="text-emerald-400">"tok_abc123",
400">class="text-emerald-400">"view_url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//app.lvng.ai/emails/tok_abc123"
}
}/api/v2/emails/sendAuthenticatedSend a new email via the Resend API. Requires at least one recipient, a subject, and either HTML or text content.
Body Parameters
tostring | string[]requiredRecipient email address(es).
subjectstringrequiredEmail subject line.
htmlstringHTML email body. Required if text is not provided.
textstringPlain text email body. Required if html is not provided.
fromstringSender email. Defaults to noreply@lvng.ai.
ccstring[]CC recipients.
bccstring[]BCC recipients.
reply_tostringReply-to email address.
tagsstring[]Tags for categorization.
workspace_idstringWorkspace to associate the email with.
channel_idstringChannel to associate the email with.
Request
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails/send \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
-H 400">class="text-emerald-400">"Content-Type: application/json" \
-d '{
400">class="text-emerald-400">"to": [400">class="text-emerald-400">"user@company.com"],
400">class="text-emerald-400">"subject": 400">class="text-emerald-400">"Your monthly report",
400">class="text-emerald-400">"html": 400">class="text-emerald-400">"<h1>Monthly Report</h1><p>Here is your summary...</p>",
400">class="text-emerald-400">"tags": [400">class="text-emerald-400">"report", 400">class="text-emerald-400">"monthly"]
}'Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"data": {
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"em_def456",
400">class="text-emerald-400">"resend_id": 400">class="text-emerald-400">"re_uvw012",
400">class="text-emerald-400">"status": 400">class="text-emerald-400">"sent",
400">class="text-emerald-400">"public_token": 400">class="text-emerald-400">"tok_def456"
}
}/api/v2/emails/:idAuthenticatedSoft-delete an email by removing its public visibility. The email record is retained but can no longer be viewed via public links.
Path Parameters
idstringrequiredUUID of the email to delete.
Request
400">curl -X 400">DELETE https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails/em_abc123 \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Email deleted"
}Public Preview
View email content via secure public tokens. These endpoints do not require authentication and are suitable for sharing email previews externally.
/api/v2/emails/view/:tokenAuthenticatedGet email preview data by public token. No authentication required. Returns sender, recipients, subject, and content.
Path Parameters
tokenstringrequiredThe public preview token.
Request
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails/view/tok_abc123Response 200
{
400">class="text-emerald-400">"success": true,
400">class="text-emerald-400">"data": {
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"em_abc123",
400">class="text-emerald-400">"400">from": 400">class="text-emerald-400">"noreply@lvng.ai",
400">class="text-emerald-400">"to": [400">class="text-emerald-400">"user@company.com"],
400">class="text-emerald-400">"cc": [],
400">class="text-emerald-400">"subject": 400">class="text-emerald-400">"Your monthly invoice",
400">class="text-emerald-400">"html": 400">class="text-emerald-400">"<html>...</html>",
400">class="text-emerald-400">"text": 400">class="text-emerald-400">"Your invoice for March 2026...",
400">class="text-emerald-400">"sent_at": 400">class="text-emerald-400">"2026-04-01T10:00:00.000Z",
400">class="text-emerald-400">"status": 400">class="text-emerald-400">"delivered"
}
}/api/v2/emails/view/:token/htmlAuthenticatedGet raw HTML content for iframe rendering. Returns text/html content type. No authentication required.
Path Parameters
tokenstringrequiredThe public preview token.
Request
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails/view/tok_abc123/htmlResponse 200
<html>
<body>
<h1>Your monthly invoice</h1>
<p>Here are your charges for March 2026...</p>
</body>
</html>