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.

GET/api/v2/emailsAuthenticated

List emails for the authenticated user's customer account. Supports filtering by workspace, status, and search.

Query Parameters

limitinteger

Maximum emails to return. Defaults to 50.

offsetinteger

Number of emails to skip for pagination.

workspace_idstring

Filter by workspace UUID.

statusstring

Filter by delivery status.

searchstring

Search by subject or recipient email.

Request

cURL
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
  }
}
GET/api/v2/emails/:idAuthenticated

Get full email details including HTML content and metadata.

Path Parameters

idstringrequired

UUID of the email.

Request

cURL
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"
  }
}
POST/api/v2/emails/sendAuthenticated

Send a new email via the Resend API. Requires at least one recipient, a subject, and either HTML or text content.

Body Parameters

tostring | string[]required

Recipient email address(es).

subjectstringrequired

Email subject line.

htmlstring

HTML email body. Required if text is not provided.

textstring

Plain text email body. Required if html is not provided.

fromstring

Sender email. Defaults to noreply@lvng.ai.

ccstring[]

CC recipients.

bccstring[]

BCC recipients.

reply_tostring

Reply-to email address.

tagsstring[]

Tags for categorization.

workspace_idstring

Workspace to associate the email with.

channel_idstring

Channel to associate the email with.

Request

cURL
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"
  }
}
DELETE/api/v2/emails/:idAuthenticated

Soft-delete an email by removing its public visibility. The email record is retained but can no longer be viewed via public links.

Path Parameters

idstringrequired

UUID of the email to delete.

Request

cURL
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.

GET/api/v2/emails/view/:tokenAuthenticated

Get email preview data by public token. No authentication required. Returns sender, recipients, subject, and content.

Path Parameters

tokenstringrequired

The public preview token.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails/view/tok_abc123

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">"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"
  }
}
GET/api/v2/emails/view/:token/htmlAuthenticated

Get raw HTML content for iframe rendering. Returns text/html content type. No authentication required.

Path Parameters

tokenstringrequired

The public preview token.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/emails/view/tok_abc123/html

Response 200

<html>
  <body>
    <h1>Your monthly invoice</h1>
    <p>Here are your charges for March 2026...</p>
  </body>
</html>