> ## Documentation Index
> Fetch the complete documentation index at: https://www.klavis.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Initialize snowflake sandbox with data

> Initialize the sandbox with snowflake-specific data following the defined schema.



## OpenAPI

````yaml post /sandbox/snowflake/{sandbox_id}/initialize
openapi: 3.1.0
info:
  title: Klavis AI (https://www.klavis.ai)
  description: Klavis AI - Open Source MCP Integrations for AI Applications
  version: 0.1.0
servers:
  - url: https://api.klavis.ai
    description: US Production server
  - url: https://api.eu.klavis.ai
    description: EU Production server
security: []
paths:
  /sandbox/snowflake/{sandbox_id}/initialize:
    post:
      tags:
        - sandbox
      summary: Initialize snowflake sandbox with data
      description: >-
        Initialize the sandbox with snowflake-specific data following the
        defined schema.
      operationId: initialize_sandbox_sandbox_snowflake__sandbox_id__initialize_post
      parameters:
        - name: sandbox_id
          in: path
          required: true
          schema:
            type: string
            description: The unique sandbox identifier
            title: Sandbox Id
          description: The unique sandbox identifier
        - name: init_default_data
          in: query
          required: false
          schema:
            type: boolean
            description: If true, use default test data for initialization
            default: false
            title: Init Default Data
          description: If true, use default test data for initialization
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/SnowflakeData-Input'
                - type: 'null'
              title: Request Body
            examples:
              default:
                summary: Example initialization data
                value:
                  databases:
                    - name: SANDBOX_DB
                      description: Main sandbox database for testing and development
                      schemas:
                        - name: SALES
                          tables:
                            - name: CUSTOMERS
                              columns:
                                - name: CUSTOMER_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: FIRST_NAME
                                  data_type: VARCHAR(100)
                                  nullable: false
                                - name: LAST_NAME
                                  data_type: VARCHAR(100)
                                  nullable: false
                                - name: EMAIL
                                  data_type: VARCHAR(255)
                                  nullable: false
                                - name: COUNTRY
                                  data_type: VARCHAR(100)
                                  nullable: true
                                - name: CREATED_AT
                                  data_type: TIMESTAMP_NTZ(9)
                                  nullable: true
                                  default_value: CURRENT_TIMESTAMP()
                              rows:
                                - values:
                                    CUSTOMER_ID: 1
                                    FIRST_NAME: John
                                    LAST_NAME: Doe
                                    EMAIL: john.doe@example.com
                                    COUNTRY: USA
                                    CREATED_AT: '2024-01-15T09:00:00'
                                - values:
                                    CUSTOMER_ID: 2
                                    FIRST_NAME: Jane
                                    LAST_NAME: Smith
                                    EMAIL: jane.smith@example.com
                                    COUNTRY: Canada
                                    CREATED_AT: '2024-01-15T09:05:00'
                                - values:
                                    CUSTOMER_ID: 3
                                    FIRST_NAME: Bob
                                    LAST_NAME: Johnson
                                    EMAIL: bob.johnson@example.com
                                    COUNTRY: UK
                                    CREATED_AT: '2024-01-15T09:10:00'
                                - values:
                                    CUSTOMER_ID: 4
                                    FIRST_NAME: Alice
                                    LAST_NAME: Williams
                                    EMAIL: alice.williams@example.com
                                    COUNTRY: Australia
                                    CREATED_AT: '2024-01-15T09:15:00'
                            - name: ORDERS
                              columns:
                                - name: ORDER_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: CUSTOMER_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: ORDER_DATE
                                  data_type: DATE
                                  nullable: false
                                - name: TOTAL_AMOUNT
                                  data_type: NUMBER(10,2)
                                  nullable: false
                                - name: STATUS
                                  data_type: VARCHAR(50)
                                  nullable: false
                              rows:
                                - values:
                                    ORDER_ID: 1001
                                    CUSTOMER_ID: 1
                                    ORDER_DATE: '2024-01-15'
                                    TOTAL_AMOUNT: '250.50'
                                    STATUS: COMPLETED
                                - values:
                                    ORDER_ID: 1002
                                    CUSTOMER_ID: 2
                                    ORDER_DATE: '2024-01-16'
                                    TOTAL_AMOUNT: '175.25'
                                    STATUS: SHIPPED
                                - values:
                                    ORDER_ID: 1003
                                    CUSTOMER_ID: 1
                                    ORDER_DATE: '2024-01-17'
                                    TOTAL_AMOUNT: '399.99'
                                    STATUS: PROCESSING
                                - values:
                                    ORDER_ID: 1004
                                    CUSTOMER_ID: 3
                                    ORDER_DATE: '2024-01-18'
                                    TOTAL_AMOUNT: '89.99'
                                    STATUS: COMPLETED
                                - values:
                                    ORDER_ID: 1005
                                    CUSTOMER_ID: 4
                                    ORDER_DATE: '2024-01-19'
                                    TOTAL_AMOUNT: '450.00'
                                    STATUS: PENDING
                            - name: PRODUCTS
                              columns:
                                - name: PRODUCT_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: PRODUCT_NAME
                                  data_type: VARCHAR(200)
                                  nullable: false
                                - name: CATEGORY
                                  data_type: VARCHAR(100)
                                  nullable: true
                                - name: PRICE
                                  data_type: NUMBER(10,2)
                                  nullable: false
                                - name: IN_STOCK
                                  data_type: BOOLEAN
                                  nullable: false
                                  default_value: 'TRUE'
                              rows:
                                - values:
                                    PRODUCT_ID: 101
                                    PRODUCT_NAME: Laptop Pro 15
                                    CATEGORY: Electronics
                                    PRICE: '1299.99'
                                    IN_STOCK: true
                                - values:
                                    PRODUCT_ID: 102
                                    PRODUCT_NAME: Wireless Mouse
                                    CATEGORY: Electronics
                                    PRICE: '29.99'
                                    IN_STOCK: true
                                - values:
                                    PRODUCT_ID: 103
                                    PRODUCT_NAME: Office Chair
                                    CATEGORY: Furniture
                                    PRICE: '249.99'
                                    IN_STOCK: false
                                - values:
                                    PRODUCT_ID: 104
                                    PRODUCT_NAME: Desk Lamp
                                    CATEGORY: Furniture
                                    PRICE: '45.00'
                                    IN_STOCK: true
                        - name: ANALYTICS
                          tables:
                            - name: SALES_METRICS
                              columns:
                                - name: METRIC_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: METRIC_DATE
                                  data_type: DATE
                                  nullable: false
                                - name: REVENUE
                                  data_type: NUMBER(12,2)
                                  nullable: false
                                - name: ORDERS_COUNT
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: AVG_ORDER_VALUE
                                  data_type: NUMBER(10,2)
                                  nullable: false
                              rows:
                                - values:
                                    METRIC_ID: 1
                                    METRIC_DATE: '2024-01-15'
                                    REVENUE: '250.50'
                                    ORDERS_COUNT: 1
                                    AVG_ORDER_VALUE: '250.50'
                                - values:
                                    METRIC_ID: 2
                                    METRIC_DATE: '2024-01-16'
                                    REVENUE: '175.25'
                                    ORDERS_COUNT: 1
                                    AVG_ORDER_VALUE: '175.25'
                                - values:
                                    METRIC_ID: 3
                                    METRIC_DATE: '2024-01-17'
                                    REVENUE: '399.99'
                                    ORDERS_COUNT: 1
                                    AVG_ORDER_VALUE: '399.99'
                            - name: USER_ACTIVITY
                              columns:
                                - name: ACTIVITY_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: USER_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: ACTIVITY_TYPE
                                  data_type: VARCHAR(100)
                                  nullable: false
                                - name: ACTIVITY_TIMESTAMP
                                  data_type: TIMESTAMP_NTZ(9)
                                  nullable: false
                                - name: METADATA
                                  data_type: VARIANT
                                  nullable: true
                              rows:
                                - values:
                                    ACTIVITY_ID: 1
                                    USER_ID: 1
                                    ACTIVITY_TYPE: LOGIN
                                    ACTIVITY_TIMESTAMP: '2024-01-15T08:30:00'
                                - values:
                                    ACTIVITY_ID: 2
                                    USER_ID: 1
                                    ACTIVITY_TYPE: PURCHASE
                                    ACTIVITY_TIMESTAMP: '2024-01-15T10:45:00'
                                - values:
                                    ACTIVITY_ID: 3
                                    USER_ID: 2
                                    ACTIVITY_TYPE: LOGIN
                                    ACTIVITY_TIMESTAMP: '2024-01-16T09:15:00'
                    - name: TEST_DB
                      description: Secondary database for integration testing
                      schemas:
                        - name: OBSERVATION
                          tables:
                            - name: TEST_LOGS
                              columns:
                                - name: LOG_ID
                                  data_type: NUMBER(38,0)
                                  nullable: false
                                - name: LOG_MESSAGE
                                  data_type: VARCHAR(1000)
                                  nullable: false
                                - name: LOG_LEVEL
                                  data_type: VARCHAR(20)
                                  nullable: false
                                - name: CREATED_AT
                                  data_type: TIMESTAMP_NTZ(9)
                                  nullable: false
                              rows:
                                - values:
                                    LOG_ID: 1
                                    LOG_MESSAGE: Application started successfully
                                    LOG_LEVEL: INFO
                                    CREATED_AT: '2024-01-15T08:00:00'
                                - values:
                                    LOG_ID: 2
                                    LOG_MESSAGE: Database connection established
                                    LOG_LEVEL: INFO
                                    CREATED_AT: '2024-01-15T08:00:05'
                                - values:
                                    LOG_ID: 3
                                    LOG_MESSAGE: 'Warning: High memory usage detected'
                                    LOG_LEVEL: WARNING
                                    CREATED_AT: '2024-01-15T10:30:00'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitializeSandboxResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SnowflakeData-Input:
      properties:
        databases:
          items:
            $ref: '#/components/schemas/SnowflakeDatabase-Input'
          type: array
          title: Databases
          description: List of databases with their schemas
      type: object
      title: SnowflakeData
      description: |-
        Complete Snowflake sandbox data structure.

        Hierarchical structure for initialization:
        - Databases contain Schemas
        - Schemas contain Tables
        - Tables contain Columns and Rows
    InitializeSandboxResponse:
      properties:
        sandbox_id:
          type: string
          title: Sandbox Id
          description: Sandbox identifier
        status:
          $ref: '#/components/schemas/SandboxStatus'
          description: Current status
        message:
          type: string
          title: Message
          description: Initialization result message
      type: object
      required:
        - sandbox_id
        - status
        - message
      title: InitializeSandboxResponse
      description: Response model for sandbox initialization
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SnowflakeDatabase-Input:
      properties:
        name:
          type: string
          title: Name
          description: >-
            Database name, cannot be 'SNOWFLAKE' or 'USER$...' since they are
            default databases
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Database description
        schemas:
          anyOf:
            - items:
                $ref: '#/components/schemas/SnowflakeSchema-Input'
              type: array
            - type: 'null'
          title: Schemas
          description: Schemas in this database
      type: object
      required:
        - name
      title: SnowflakeDatabase
      description: Snowflake Database object
    SandboxStatus:
      type: string
      enum:
        - idle
        - occupied
        - error
      title: SandboxStatus
      description: Status of a sandbox instance - matches database enum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SnowflakeSchema-Input:
      properties:
        name:
          type: string
          title: Name
          description: Schema name, cannot be 'PUBLIC' since it's a default schema
        tables:
          anyOf:
            - items:
                $ref: '#/components/schemas/SnowflakeTable-Input'
              type: array
            - type: 'null'
          title: Tables
          description: Tables in this schema
      type: object
      required:
        - name
      title: SnowflakeSchema
      description: Snowflake Schema object (namespace within a database)
    SnowflakeTable-Input:
      properties:
        name:
          type: string
          title: Name
          description: Table name
        columns:
          items:
            $ref: '#/components/schemas/SnowflakeColumn-Input'
          type: array
          title: Columns
          description: List of columns in the table
        rows:
          anyOf:
            - items:
                $ref: '#/components/schemas/SnowflakeRow-Input'
              type: array
            - type: 'null'
          title: Rows
          description: Initial data rows for the table
      type: object
      required:
        - name
        - columns
      title: SnowflakeTable
      description: Snowflake Table object
    SnowflakeColumn-Input:
      properties:
        name:
          type: string
          title: Name
          description: Column name
        data_type:
          type: string
          title: Data Type
          description: Column data type (e.g., VARCHAR, NUMBER, TIMESTAMP)
        nullable:
          type: boolean
          title: Nullable
          description: Whether the column can be NULL
          default: true
        default_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Value
          description: Default value for the column
      type: object
      required:
        - name
        - data_type
      title: SnowflakeColumn
      description: Snowflake Table Column definition
    SnowflakeRow-Input:
      properties:
        values:
          additionalProperties: true
          type: object
          title: Values
          description: Column name to value mapping for the row
      type: object
      required:
        - values
      title: SnowflakeRow
      description: Snowflake Table Row data
  securitySchemes:
    HTTPBearer:
      type: http
      description: Your Klavis AI API key.
      scheme: bearer
      x-fern-bearer:
        name: api_key

````