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

# Initialize hubspot sandbox with data

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

## Request

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

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

- HubSpotDataInput: Complete HubSpot sandbox data structure (Flat Schema). All object types are top-level lists. Relationships are defined via association fields in the respective objects (e.g. associated_company_names in HubSpotContact).
  - `companies` HubSpotCompanyInput[], nullable: List of companies
    - `company_name` string, required: Company name
    - `website_domain` string, nullable: Company website domain
    - `industry` string, nullable: Company industry
    - `city` string, nullable: Company city
    - `state_region` string, nullable: Company state/region
    - `country` string, nullable: Company country
    - `phone_number` string, nullable: Company phone number
    - `employee_count` string, nullable: Number of employees
    - `yearly_revenue` string, nullable: Yearly revenue
  - `contacts` HubSpotContactInput[], nullable: List of contacts
    - `first_name` string, required: Contact first name
    - `last_name` string, required: Contact last name
    - `email_address` string, required: Contact email address
    - `phone_number` string, nullable: Contact phone number
    - `job_title` string, nullable: Contact job title
  - `deals` HubSpotDealInput[], nullable: List of deals
    - `title` string, required: Deal title
    - `value` string, nullable: Deal value/amount
    - `stage` string, nullable: Deal stage
    - `pipeline` string, nullable: Deal pipeline
    - `expected_close_date` string, nullable: Expected close date
  - `tickets` HubSpotTicketInput[], nullable: List of tickets
    - `title` string, required: Ticket title
    - `description` string, nullable: Ticket description/details
    - `pipeline` string, nullable: Ticket pipeline
    - `workflow_stage` string, nullable: Ticket workflow stage
    - `priority_level` string, nullable: Ticket priority (HIGH, MEDIUM, LOW)
  - `tasks` HubSpotTaskInput[], nullable: List of tasks
    - `title` string, required: Task title
    - `description` string, nullable: Task description/details
    - `task_status` string, nullable: Task status (NOT_STARTED, IN_PROGRESS, COMPLETED, WAITING, DEFERRED)
    - `priority_level` string, nullable: Task priority (HIGH, MEDIUM, LOW)
    - `deadline` string, nullable: Task deadline (ISO 8601 format)

## 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/hubspot/: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)
