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

# Initialize salesforce sandbox with data

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

Initialize the sandbox with salesforce-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

- SalesforceDataInput — Complete Salesforce sandbox data
  - `accounts` Account[], nullable
    - `name` string, required — Company name
    - `industry` string, nullable — e.g., Technology, Healthcare, Finance
    - `type` string, nullable — e.g., Customer, Prospect, Partner
    - `phone` string, nullable
    - `website` string, nullable
    - `revenue` number, nullable — Annual revenue
    - `employees` integer, nullable
    - `address` Address — Reusable address structure
      - `street` string, nullable
      - `city` string, nullable
      - `state` string, nullable
      - `postal_code` string, nullable
      - `country` string, nullable
    - `description` string, nullable
    - `rating` string, nullable — e.g., Hot, Warm, Cold
  - `contacts` Contact[], nullable
    - `first_name` string, nullable
    - `last_name` string, required
    - `email` string, email, nullable
    - `phone` string, nullable
    - `mobile` string, nullable
    - `title` string, nullable — Job title
    - `department` string, nullable
    - `account_id` string, nullable — Related account ID
    - `address` Address — Reusable address structure
      - `street` string, nullable
      - `city` string, nullable
      - `state` string, nullable
      - `postal_code` string, nullable
      - `country` string, nullable
    - `description` string, nullable
    - `source` string, nullable — e.g., Web, Phone, Referral
  - `opportunities` Opportunity[], nullable
    - `name` string, required
    - `stage` string, required — e.g., Prospecting, Qualification, Closed Won
    - `close_date` string, required — Expected close date (YYYY-MM-DD)
    - `amount` number, nullable
    - `probability` integer, nullable
    - `account_id` string, nullable — Related account ID
    - `type` string, nullable — e.g., New Business, Renewal
    - `source` string, nullable — Lead source
    - `next_step` string, nullable
    - `description` string, nullable
  - `leads` Lead[], nullable
    - `first_name` string, nullable
    - `last_name` string, required
    - `company` string, required
    - `email` string, email, nullable
    - `phone` string, nullable
    - `mobile` string, nullable
    - `title` string, nullable
    - `status` string, nullable
    - `source` string, nullable — e.g., Web, Phone, Referral
    - `industry` string, nullable
    - `rating` string, nullable — e.g., Hot, Warm, Cold
    - `address` Address — Reusable address structure
      - `street` string, nullable
      - `city` string, nullable
      - `state` string, nullable
      - `postal_code` string, nullable
      - `country` string, nullable
    - `website` string, nullable
    - `description` string, nullable
    - `employees` integer, nullable
    - `revenue` number, nullable
  - `cases` Case[], nullable
    - `subject` string, required
    - `status` string, nullable
    - `priority` string, nullable — High, Medium, or Low
    - `origin` string, nullable — e.g., Phone, Email, Web
    - `type` string, nullable — e.g., Problem, Question, Feature Request
    - `reason` string, nullable
    - `account_id` string, nullable
    - `contact_id` string, nullable
    - `description` string, nullable
    - `customer_email` string, email, nullable
    - `customer_name` string, nullable
    - `customer_phone` string, nullable
  - `campaigns` Campaign[], nullable
    - `name` string, required
    - `type` string, nullable — e.g., Email, Webinar, Conference
    - `status` string, nullable
    - `start_date` string, nullable — YYYY-MM-DD
    - `end_date` string, nullable — YYYY-MM-DD
    - `expected_revenue` number, nullable
    - `budget` number, nullable
    - `actual_cost` number, nullable
    - `description` string, nullable
    - `active` boolean, nullable

## 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/versions/1f05ced7280f/schema)
