Skip to main content
POST
/
sandbox
/
resend
/
{sandbox_id}
/
initialize
Initialize resend sandbox with data
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
{
  "sandbox_id": "<string>",
  "status": "idle",
  "message": "<string>",
  "records_created": {}
}

Authorizations

Authorization
string
header
required

Your Klavis AI API key.

Path Parameters

sandbox_id
string
required

The unique sandbox identifier

Query Parameters

init_default_data
boolean
default:false

If true, use default test data for initialization

Body

application/json

Complete Resend sandbox data structure.

Mixed structure:

  • Segments contain nested Broadcasts (broadcasts MUST have a segment)
  • Emails are standalone (transactional)
  • Contacts are standalone (can be optionally linked to segments)
emails
ResendEmail · object[] | null

List of standalone transactional emails

contacts
ResendContact · object[] | null

List of standalone contacts

segments
ResendSegment · object[] | null

List of segments with nested broadcasts

Response

Successful Response

Response model for sandbox initialization

sandbox_id
string
required

Sandbox identifier

status
enum<string>
required

Current status

Available options:
idle,
occupied
message
string
required

Initialization result message

records_created
Records Created · object

Count of records created per object type