On this page

POST/campaigns/:id/leads/:leadId/preview

Dry-run of the email the campaign’s assigned agent would write for this lead. Nothing is sent, queued, or stored. Requires an assigned agent (409 when none).

0 credits. Rate class: campaign_control (default 20/min).

Request

POST /campaigns/camp_abc/leads/lead_1/preview
X-API-Key: sk_live_...
Content-Type: application/json

Body is optional (empty / omitted → messageType: "initial").

{
  "messageType": "followUp",
  "followUpIndex": 0,
  "accountId": "acc_1"
}
FieldRequiredNotes
messageTypeNoinitial (default) · followUp · reply
followUpIndexNo0-based; only valid when messageType is followUp (0–50)
accountIdNoConnected mailbox for the draft; defaults to the lead’s account or the first connected mailbox

Response

{
  "campaignId": "camp_abc",
  "leadId": "lead_1",
  "templateId": "tpl_abc",
  "messageType": "initial",
  "subject": "Quick idea for Acme",
  "body": "Hi …",
  "contentFormat": "plain",
  "validation": { "pass": true, "reason": null, "violations": [] },
  "dryRun": true
}

Errors

validation_error · not_found · conflict (no agent assigned) · rate_limited · upstream_unavailable

MCP

Tool: preview_lead.