Skip to main content
POST
/
api
/
v1
/
personalize
/
preview
Sync preview of a personalized email for a single lead
curl --request POST \
  --url https://api.example.com/api/v1/personalize/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "lead_data": {},
  "sender_profile_id": "<string>",
  "sender_data": {},
  "custom_prompt": "<string>",
  "research_context": "<string>",
  "dataset_id": "<string>",
  "row_index": 1,
  "force_refresh_research": false
}
'
{
  "subject": "<string>",
  "email_body": "<string>",
  "commonality": {
    "text": "<string>",
    "confidence_score": 123,
    "rarity_score": 123,
    "relevance_score": 123,
    "supporting_evidence": [
      "<string>"
    ]
  },
  "prompt_source": "<string>",
  "model_used": "<string>",
  "latency_ms": 123,
  "research_sources": [
    {
      "name": "<string>",
      "status": "<string>",
      "summary": "",
      "meta": {},
      "from_cache": false
    }
  ],
  "research_chars": 0,
  "research_latency_ms": 0,
  "research_from_cache": false,
  "research_cached_at": "<string>",
  "research_meta": {}
}

Documentation Index

Fetch the complete documentation index at: https://bavlio.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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

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.