---
title: "Initialize resend sandbox with data"
method: POST
path: "/sandbox/resend/{sandbox_id}/initialize"
tags: ["sandbox"]
---

# Initialize resend sandbox with data

`POST /sandbox/resend/{sandbox_id}/initialize`

Initialize the sandbox with resend-specific data following the defined schema.

## Path parameters

- `sandbox_id` string, required — The unique sandbox identifier

## Query parameters

- `init_default_data` boolean — If true, use default test data for initialization

## Request body

- ResendDataInput — 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` ResendEmailInput[], nullable — List of standalone transactional emails
    - `id` string, nullable — Email ID (read-only, set by Resend)
    - `from` string, required — Sender email address
    - `to` string[], required — Recipient email addresses
    - `subject` string, required — Email subject
    - `html` string, nullable — HTML content of the email
    - `text` string, nullable — Plain text content of the email
    - `reply_to` string, nullable — Reply-to email address
    - `cc` string[], nullable — CC email addresses
    - `bcc` string[], nullable — BCC email addresses
    - `tags` object[], nullable — Email tags for categorization
    - `created_at` string, nullable — Creation timestamp
  - `contacts` ResendContactInput[], nullable — List of standalone contacts
    - `id` string, nullable — Contact ID (read-only, set by Resend)
    - `email` string, required — The email address of the contact.
    - `first_name` string, nullable — Contact first name
    - `last_name` string, nullable — Contact last name
    - `unsubscribed` boolean, nullable — Whether contact is unsubscribed from all Broadcasts
    - `created_at` string, nullable — Creation timestamp
  - `segments` ResendSegmentInput[], nullable — List of segments with nested broadcasts
    - `id` string, nullable — Segment ID (read-only, set by Resend)
    - `name` string, required — Segment name
    - `created_at` string, nullable — Creation timestamp
    - `broadcasts` ResendBroadcastInput[], nullable — Broadcasts sent to this segment
      - `id` string, nullable — Broadcast ID (read-only, set by Resend)
      - `from` string, required — Sender email with optional display name
      - `subject` string, required — Email subject
      - `name` string, nullable — Broadcast name for internal reference
      - `html` string, nullable — HTML content
      - `text` string, nullable — Plain text content
      - `reply_to` string, nullable — Reply-to email address
      - `status` string, nullable — Broadcast status (draft, sent, etc.)
      - `created_at` string, nullable — Creation timestamp
      - `scheduled_at` string, nullable — Scheduled send timestamp
      - `sent_at` string, nullable — Actual send timestamp
      - `topic_id` string, nullable — Topic ID for scoping

## Response `200`

Successful Response

- InitializeSandboxResponse — Response model for sandbox initialization
  - `sandbox_id` string, required — Sandbox identifier
  - `status` 'idle' | 'occupied' | 'error', required — Status of a sandbox instance - matches database enum
  - `message` string, required — Initialization result message

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai.md) · [All operations](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/klavis-ai/klavis-ai-https-www-klavis-ai/revisions/1f05ced7280f/schema)
