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

# Initialize close sandbox with data

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

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

- CloseDataInput — Complete Close sandbox data structure. Nested hierarchy for initialization: - Leads contain Contacts, Opportunities, and Tasks
  - `leads` CloseLeadInput[], nullable — List of leads with nested objects
    - `name` string, required — Lead name/company name
    - `status` string, nullable — Lead status
    - `contacts` CloseContactInput[], nullable — Contacts associated with this lead
      - `name` string, nullable — Contact full name
      - `emails` object[], nullable — List of email objects
      - `phones` object[], nullable — List of phone objects
    - `opportunities` CloseOpportunityInput[], nullable — Opportunities associated with this lead
      - `note` string, required — Opportunity note/description
      - `value` integer, nullable — Opportunity value in cents
      - `confidence` integer, nullable — Confidence percentage (0-100)
      - `period` string, nullable — Billing period (e.g., 'one_time', 'monthly', 'annual')
    - `tasks` CloseTaskInput[], nullable — Tasks associated with this lead
      - `description` string, required — Task description
      - `date` string, nullable — The date when the task is actionable
      - `completed` boolean, nullable — Whether task is completed
      - `assignee_id` string, nullable — User ID assigned to

## 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)
