Skip to main content
POST
/
sandbox
/
notion
/
{sandbox_id}
/
initialize
Initialize notion sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/notion/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "databases": [
    {
      "title": "<string>",
      "description": "<string>",
      "icon": "<string>",
      "data_sources": [
        {
          "name": "<string>",
          "description": "<string>",
          "schema": {},
          "pages": [
            {
              "title": "<string>",
              "properties": {},
              "blocks": [
                {
                  "type": "<string>",
                  "content": "<string>"
                }
              ],
              "comments": [
                {
                  "text": "<string>"
                }
              ],
              "data_source_name": "<string>"
            }
          ]
        }
      ]
    }
  ],
  "pages": [
    {
      "title": "<string>",
      "properties": {},
      "blocks": [
        {
          "type": "<string>",
          "content": "<string>"
        }
      ],
      "comments": [
        {
          "text": "<string>"
        }
      ],
      "data_source_name": "<string>"
    }
  ]
}
'
{
  "sandbox_id": "<string>",
  "status": "idle",
  "message": "<string>",
  "records_created": {}
}

Authorizations

Authorization
string
header
required

Your Klavis AI API key.

Path Parameters

sandbox_id
string
required

The unique sandbox identifier

Body

application/json

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 data_source_name)
  • Data Sources are nested in Databases
databases
NotionDatabase · object[] | null

List of databases with their data sources and pages

pages
NotionPage · object[] | null

List of standalone pages (not in databases)

Response

Successful Response

Response model for sandbox initialization

sandbox_id
string
required

Sandbox identifier

status
enum<string>
required

Current status

Available options:
idle,
occupied
message
string
required

Initialization result message

records_created
Records Created · object

Count of records created per object type