Developers
Commercial insurance API recipes
Fictional, copyable examples for the real work: trucking prospects, renewal outreach, quote/bind attribution, and production reporting.
Campaign creation is draft-only. Launch is a separate call after a human reviews the audience, permission basis, suppression result, sender, and preview.
# Seven16 Email API recipes for commercial insurance
These examples use fictional data. Keep the API key in an environment variable,
never in source control. Creating a campaign creates a draft; launching it is a
separate deliberate call.
## 1. Add a permitted trucking prospect
```ts
import { Seven16Email } from "@seven16/email";
const email = new Seven16Email({
apiKey: process.env.SEVEN16_EMAIL_API_KEY!,
productTenantId: process.env.SEVEN16_TENANT_ID!,
});
await email.contacts.create({
email: "fictional.fleet@example.com",
first_name: "Jordan",
last_name: "Reed",
contact_type: "prospect",
lifecycle_stage: "lead",
consent_status: "unknown",
state: "TX",
policy_expiration_date: "2027-01-15",
current_insurer_name: "Fictional Carrier",
});
```
Only contact people your organization is legally and contractually permitted to
contact. The API does not turn a purchased, scraped, or prohibited list into an
allowed audience.
## 2. Build a renewal campaign as a draft
```ts
const draft = await email.campaigns.create({
name: "January commercial-auto renewal review",
sender_profile_id: process.env.SEVEN16_SENDER_ID!,
audience_mode: "segment",
segment_id: process.env.SEVEN16_RENEWAL_SEGMENT_ID!,
subject: "Planning ahead for your commercial auto renewal",
body_html: "<p>Hi {{ first_name }}, let’s review what changed before renewal.</p>",
campaign_goal: "renewal_reminder",
message_purpose: "marketing_campaign",
});
console.log(draft.campaign_id, draft.status); // draft — nothing sent
```
Review the draft, audience count, suppression checks, sender, links, and preview
in the dashboard. Launch only after a human approves it:
```ts
await email.campaigns.launch(draft.campaign_id);
```
## 3. Attribute a quote or bind back to outreach
```ts
await email.outcomes.record({
outcome_type: "bind",
contact_email: "fictional.fleet@example.com",
premium_amount: 18450,
source_event_id: "ams-bind-fictional-1007",
occurred_at: new Date().toISOString(),
});
```
Use a stable source event ID from your CRM or agency-management system. Replays
remain idempotent, and a matched conversion can stop an outcome-exit sequence.
## 4. Read performance for an insurance production review
```ts
const performance = await email.analytics.overview({
from: "2026-07-01T00:00:00Z",
to: "2026-08-01T00:00:00Z",
});
```
Use clicks and connected outcomes for decisions; privacy protections can inflate
open counts.
← Back to API overview