Skip to main content
POST
Sync preview of a personalized email for a single lead

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Input for the sync personalization preview.

lead_data
Lead Data · object
required

The lead fields to personalize against (company, role, linkedin_url, etc.)

sender_profile_id
string | null

ID of a saved sender profile. If omitted, sender_data must be provided.

sender_data
Sender Data · object | null

Inline sender profile data. Ignored if sender_profile_id is provided.

custom_prompt
string | null

Optional prompt override. Must be 100-5000 characters if provided.

research_context
string | null

Optional pre-fetched research context (overrides enrichment). Max 20000 chars.

Maximum string length: 20000
dataset_id
string | null

Optional dataset id for research cache persistence. Paired with row_index.

row_index
integer | null

Row index within the dataset. Required when dataset_id is set.

Required range: x >= 0
force_refresh_research
boolean
default:false

Bypass the research cache and fetch fresh (e.g. user hit 'Refresh research').

Response

Successful Response

subject
string
required
email_body
string
required
commonality
PersonalizationPreviewCommonality · object
required
prompt_source
string
required

Which prompt was used: 'default', 'sender_profile_custom', or 'custom_override'.

model_used
string
required
latency_ms
integer
required
research_sources
PersonalizationPreviewResearchSource · object[]

Which enrichment sources ran and whether they succeeded.

research_chars
integer
default:0
research_latency_ms
integer
default:0
research_from_cache
boolean
default:false
research_cached_at
string | null
research_meta
Research Meta · object

Aggregate research metadata. Currently exposes zero_research_reason (one of the ZERO_RESEARCH_REASON_* enum values) when the joined research_chars was below the useful threshold. Used by ops sweep scripts to derive a per-cohort distribution of why some leads return empty research.

sources
PersonalizationSource · object[]

Per-URL personalization sources surfaced for the citations panel (plan AC-15). Empty when no research surface was available or when the preview path supplied research_context without a sources array.

claim_sentences
ClaimSentence · object[]

LLM-emitted factual-claim sentences with their source_indices (1-indexed into sources) and UTF-16 code-unit offsets into body_clean (plan AC-16). Empty list when the LLM emitted no claims or when no sources were available to ground them.

ungrounded_claim_count
integer
default:0

Count of claim_sentences with empty source_indices (plan AC-10a). Used by the frontend to render the ungrounded warning banner.

Required range: x >= 0
body_clean
string | null

The LLM plain-text email body verbatim — the same string as email_body, surfaced separately so frontends can index claim_sentences[].body_offset_* against a stable reference even if email_body is later mutated by signature stitching elsewhere in the pipeline (plan AC-12). None on pre-feature responses.