curl --request POST \
--url https://api.klavis.ai/sandbox/resend/{sandbox_id}/initialize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"contacts": [
{
"email": "[email protected]",
"first_name": "Robert",
"last_name": "Johnson",
"unsubscribed": false
},
{
"email": "[email protected]",
"first_name": "Maria",
"last_name": "Garcia",
"unsubscribed": false
},
{
"email": "[email protected]",
"first_name": "David",
"last_name": "Lee",
"unsubscribed": false
}
],
"segments": [
{
"name": "Premium Customers",
"broadcasts": [
{
"from": "[email protected]",
"subject": "Exclusive Premium Member Benefits This Month",
"name": "Premium Benefits December",
"html": "<h1>Premium Member Exclusive</h1><p>As a valued premium member, enjoy these exclusive benefits this month...</p><ul><li>20% off all products</li><li>Early access to new features</li><li>Priority support</li></ul>",
"text": "Premium Member Exclusive - Enjoy 20% off all products, early access to new features, and priority support this month.",
"status": "draft"
}
]
},
{
"name": "Newsletter Subscribers",
"broadcasts": [
{
"from": "[email protected]",
"subject": "ACME Monthly Newsletter - December 2025",
"name": "December Newsletter",
"html": "<div><h1>December Newsletter</h1><h2>What's New This Month</h2><p>Here are the highlights from December...</p><ul><li>Product updates</li><li>Customer success stories</li><li>Upcoming events</li></ul></div>",
"text": "December Newsletter - What's New This Month: Product updates, customer success stories, and upcoming events.",
"reply_to": "[email protected]",
"status": "draft"
}
]
},
{
"name": "Trial Users",
"broadcasts": [
{
"from": "[email protected]",
"subject": "Getting Started with Your Free Trial",
"name": "Trial Onboarding Sequence",
"html": "<h1>Welcome to Your Free Trial!</h1><p>Let's get you started with some helpful resources...</p><div><h3>Quick Start Guide</h3><ol><li>Complete your profile</li><li>Explore the dashboard</li><li>Try our key features</li></ol></div>",
"text": "Welcome to Your Free Trial! Quick Start Guide: 1) Complete your profile 2) Explore the dashboard 3) Try our key features",
"status": "draft"
}
]
}
]
}
EOF