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

# Initialize notion sandbox with data

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

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

- NotionDataInput — Complete Notion sandbox data structure. Hierarchical structure for initialization: - Databases contain Data Sources - Data Sources contain Pages (with properties matching the schema) - Standalone Pages exist at top level (not in databases) - Pages contain Blocks (content) and Comments Relational structure: - Pages refer to Data Sources (via parent_source) - Data Sources are nested in Databases
  - `databases` NotionDatabaseInput[], nullable — List of databases with their data sources and pages
    - `name` string, required — Database title
    - `summary` string, nullable — Database description
    - `display_icon` string, nullable — Database icon (emoji or external URL)
    - `sources` NotionDataSourceInput[], nullable — Data sources within this database
      - `label` string, required — Data source name
      - `summary` string, nullable — Data source description
      - `fields` object, nullable — Schema definition (property types and configurations)
      - `pages` NotionPageInput[], nullable — Pages (items/rows) in this data source
        - `name` string, required — Page title
        - `attributes` object, nullable — Page properties (for database pages)
        - `content_blocks` NotionBlockInput[], nullable — Content blocks in this page
          - `block_type` string, required — Block type (paragraph, heading_1, heading_2, etc.)
          - `content` string, required — Block text content
        - `comments` NotionCommentInput[], nullable — Comments on this page
          - `content` string, required — Comment text content (rich text)
        - `parent_source` string, nullable — Name of the data source this page belongs to (for initialization)
  - `pages` NotionPageInput[], nullable — List of standalone pages (not in databases)
    - `name` string, required — Page title
    - `attributes` object, nullable — Page properties (for database pages)
    - `content_blocks` NotionBlockInput[], nullable — Content blocks in this page
      - `block_type` string, required — Block type (paragraph, heading_1, heading_2, etc.)
      - `content` string, required — Block text content
    - `comments` NotionCommentInput[], nullable — Comments on this page
      - `content` string, required — Comment text content (rich text)
    - `parent_source` string, nullable — Name of the data source this page belongs to (for initialization)

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