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

# Initialize google_cloud sandbox with data

`POST /local-sandbox/google_cloud/{sandbox_id}/initialize`

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

- GoogleCloudDataInput — Complete Google Cloud sandbox data structure
  - `datasets` BigQueryDataset[], nullable — BigQuery datasets
    - `id` string, required — Dataset ID
    - `description` string, nullable — Dataset description
    - `location` string — Dataset location
    - `created_at` string, nullable — Creation timestamp
    - `updated_at` string, nullable — Last modified timestamp
  - `tables` BigQueryTableInput[], nullable — BigQuery tables
    - `dataset_id` string, required — Parent dataset ID
    - `id` string, required — Table ID
    - `description` string, nullable — Table description
    - `fields` BigQueryFieldInput[], nullable — Table schema fields
      - `name` string, required — Field name
      - `type` string, required — Field type (STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP, RECORD, etc.)
      - `mode` string, nullable — Field mode (NULLABLE, REQUIRED, REPEATED)
      - `description` string, nullable — Field description
      - `fields` BigQueryFieldInput[], nullable — Nested fields for RECORD type
    - `row_count` string, nullable — Number of rows
    - `created_at` string, nullable — Creation timestamp
  - `buckets` StorageBucket[], nullable — Cloud Storage buckets
    - `name` string, required — Bucket name
    - `location` string — Bucket location
    - `storage_class` string — Storage class
    - `versioning_enabled` boolean — Whether versioning is enabled
    - `lifecycle_rules` LifecycleRule[], nullable — Lifecycle rules
      - `action` string, required — Action type (Delete, SetStorageClass)
      - `action_storage_class` string, nullable — Target storage class for SetStorageClass action
      - `age_days` integer, nullable — Age in days to trigger rule
      - `created_before` string, nullable — Created before date
      - `is_live` boolean, nullable — Apply to live versions only
      - `num_newer_versions` integer, nullable — Number of newer versions to keep
    - `created_at` string, nullable — Creation timestamp
    - `updated_at` string, nullable — Last update timestamp
  - `objects` StorageObject[], nullable — Cloud Storage objects
    - `bucket` string, required — Bucket name
    - `name` string, required — Object name/path
    - `content_type` string, nullable — Content type
    - `size` string, nullable — Object size in bytes
    - `content` string, nullable — Object content (for initialization)
    - `md5_hash` string, nullable — MD5 hash
    - `created_at` string, nullable — Creation timestamp
    - `updated_at` string, nullable — Last update timestamp
  - `log_entries` LogEntry[], nullable — Log entries
    - `log_name` string, required — Log name
    - `message` string, nullable — Text message payload
    - `json_data` object, nullable — JSON payload
    - `severity` string — Log severity (DEBUG, INFO, WARNING, ERROR, CRITICAL)
    - `timestamp` string, nullable — Entry timestamp
    - `resource_type` string, nullable — Resource type (e.g., gce_instance, cloud_function)
    - `resource_labels` object, nullable — Resource labels
  - `log_sinks` LogSink[], nullable — Log sinks
    - `name` string, required — Sink name
    - `filter` string, nullable — Log filter expression
    - `description` string, nullable — Sink description
    - `created_at` string, nullable — Creation timestamp
    - `updated_at` string, nullable — Update timestamp
  - `log_buckets` LogBucket[], nullable — Log buckets
    - `name` string, required — Bucket name/ID
    - `location` string — Bucket location
    - `retention_days` integer — Retention period in days
    - `description` string, nullable — Bucket description
    - `created_at` string, nullable — Creation timestamp
    - `updated_at` string, nullable — Update timestamp
  - `instances` ComputeInstance[], nullable — Compute Engine instances
    - `name` string, required — Instance name
    - `zone` string, required — Instance zone
    - `machine_type` string — Machine type
    - `status` string — Instance status
    - `description` string, nullable — Instance description
    - `labels` object, nullable — Instance labels
    - `created_at` string, nullable — Creation timestamp

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