---
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`

## Request

- Base URL: `https://api.klavis.ai`
- URL: `https://api.klavis.ai/sandbox/salesforce/{sandbox_id}/initialize`
- Auth: HTTP bearer

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

## Changes

- **2026-02-09** `522418a391e5`: 1 warning
  - removed the optional property `records_created` from the response with the `200` status
- **2026-02-08** `d70b82139caa`: 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-01-31** `4457a0cdcfab`: 1 warning
  - added the new `error` enum value to the `status` response property for the response status `200`

[Operation history](https://skmtc.dev/klavis-ai/apis/klavis-ai-https-www-klavis-ai/changes/sandbox/salesforce/:sandbox_id/initialize/post.md)

---

[API](https://skmtc.dev/klavis-ai/apis/klavis-ai-https-www-klavis-ai.md) - [All operations](https://skmtc.dev/klavis-ai/apis/klavis-ai-https-www-klavis-ai/llms.txt) - [OpenAPI document](https://skmtc.dev/klavis-ai/apis/klavis-ai-https-www-klavis-ai/revisions/1f05ced7280f?raw)
