Campaigns
Preview a campaign email
Renders draft email content using the selected contact's fields and declared templateData fallbacks.
POST
Renders draft email content using the selected contact's fields and declared templateData fallbacks. Creates no campaign run or message. Omit contactId to preview the fallback data alone.
apiKeyheader
x-api-key<token>application/json- body
content*||audience*contactId?|nullCampaignPreview
application/json- response
subject*stringpreheader?stringhtml*stringLength
length <= 2097152text*stringLength
length <= 2097152import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.campaigns.preview({ "content": { "channel": "email", "email": {} }, "audience": { "topicId": "example" }});Example Response
{ "subject": "string", "preheader": "string", "html": "string", "text": "string"}Related documentation
Pause a campaign run
Pauses an in-progress campaign run and returns the updated run. Use this endpoint to pause a campaign run through the Samva email API.
Resume a campaign run
Resumes a paused campaign run and returns the updated run. Campaigns need a paid plan: on Free this is refused with PaymentRequiredError.