The SDK groups API operations by resource. Each resource client maps to common Lumail workflows.

## Subscribers

Create or update a subscriber and optionally trigger matching workflows.

```typescript
const { subscriber } = await lumail.subscribers.create({
  email: "user@example.com",
  name: "Jane Doe",
  tags: ["newsletter", "customer"],
  fields: { plan: "pro" },
  triggerWorkflows: true,
});
```

Update subscriber fields or replace tags later:

```typescript
await lumail.subscribers.update("user@example.com", {
  fields: { plan: "enterprise" },
  tags: ["enterprise"],
  replaceTags: true,
});
```

## Campaigns

Create campaigns, fetch details, update drafts, and send immediately or on a schedule.

```typescript
const { campaignId } = await lumail.campaigns.create({
  subject: "Welcome to the newsletter",
  name: "Welcome Campaign",
  preview: "Here is what to expect.",
  contentType: "MARKDOWN",
});

await lumail.campaigns.send(campaignId, {
  scheduledAt: "2026-06-01T09:00:00Z",
  timezone: "Europe/Paris",
});
```

## Transactional Emails

Send transactional email from a verified domain.

```typescript
await lumail.emails.send({
  to: "user@example.com",
  from: "hello@yourdomain.com",
  subject: "Your receipt",
  content: "Thanks for your purchase.",
  contentType: "MARKDOWN",
  transactional: true,
});
```

To send a React Email template, render it to HTML and pass `contentType: "HTML"` - see [Send React Email Templates with Lumail](/docs/tutorials/react-email).

## Email Verification

Validate an address before storing or sending to it.

```typescript
const result = await lumail.emails.verify({ email: "test@example.com" });

if (!result.success) {
  console.log(result.code, result.error, result.suggestion);
}
```

## Tags

List, create, fetch, and rename tags.

```typescript
const { tags } = await lumail.tags.list();
const { tag } = await lumail.tags.create({ name: "vip" });
await lumail.tags.update(tag.id, { name: "customer" });
```

## Events

Track product activity and business events on a subscriber profile.

```typescript
await lumail.events.create({
  eventType: "SUBSCRIBER_PAYMENT",
  subscriber: "user@example.com",
  data: {
    amount: 99,
    currency: "USD",
    plan: "pro",
  },
});
```

## Related

- [Full SDK Reference](/docs/api-reference/sdk)
- [Subscriber Events](/docs/features/subscriber-events)
- [Email Verification API](/docs/api-reference/api-email-verify-post)
