> ## 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 supabase sandbox with data

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



## OpenAPI

````yaml post /sandbox/supabase/{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/supabase/{sandbox_id}/initialize:
    post:
      tags:
        - sandbox
      summary: Initialize supabase sandbox with data
      description: >-
        Initialize the sandbox with supabase-specific data following the defined
        schema.
      operationId: initialize_sandbox_sandbox_supabase__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/SupabaseData-Input'
                - type: 'null'
              title: Request Body
            examples:
              default:
                summary: Example initialization data
                value:
                  projects:
                    - name: test-project
                      tables:
                        - name: users
                          columns:
                            email: TEXT
                            name: TEXT
                            age: INTEGER
                            is_active: BOOLEAN
                            balance: REAL
                            avatar_url: TEXT
                            roles: JSONB
                            metadata: JSONB
                            created_at: TEXT
                          rows:
                            - id: 1
                              email: john@example.com
                              name: John Doe
                              age: 30
                              is_active: true
                              balance: 1250.5
                              roles:
                                - admin
                                - user
                              metadata:
                                last_login: '2024-01-15T10:00:00Z'
                                login_count: 42
                              created_at: '2024-01-01T10:00:00Z'
                            - id: 2
                              email: jane@example.com
                              name: Jane Smith
                              age: 28
                              is_active: true
                              balance: 3500.75
                              avatar_url: https://example.com/avatars/jane.jpg
                              roles:
                                - user
                              metadata:
                                last_login: '2024-01-16T11:30:00Z'
                                login_count: 156
                              created_at: '2024-01-02T11:30:00Z'
                            - id: 3
                              email: bob@example.com
                              name: Bob Johnson
                              age: 45
                              is_active: false
                              balance: 0
                              roles:
                                - user
                                - moderator
                              metadata:
                                last_login: '2023-12-20T09:15:00Z'
                                login_count: 8
                              created_at: '2024-01-03T09:15:00Z'
                        - name: posts
                          columns:
                            title: TEXT
                            content: TEXT
                            author_id: INTEGER
                            view_count: INTEGER
                            like_count: INTEGER
                            is_published: BOOLEAN
                            is_featured: BOOLEAN
                            tags: JSONB
                            rating: REAL
                            settings: JSONB
                            created_at: TEXT
                            updated_at: TEXT
                          rows:
                            - id: 101
                              title: First Post
                              content: This is my first post!
                              author_id: 1
                              view_count: 245
                              like_count: 18
                              is_published: true
                              is_featured: false
                              tags:
                                - introduction
                                - welcome
                              rating: 4.5
                              settings:
                                allow_comments: true
                                notify_author: true
                              created_at: '2024-01-01T12:00:00Z'
                            - id: 102
                              title: Hello World
                              content: Welcome to my blog
                              author_id: 2
                              view_count: 1032
                              like_count: 67
                              is_published: true
                              is_featured: true
                              tags:
                                - blog
                                - announcement
                                - community
                              rating: 4.8
                              settings:
                                allow_comments: true
                                notify_author: false
                              created_at: '2024-01-02T14:30:00Z'
                              updated_at: '2024-01-05T09:20:00Z'
                    - name: analytics-project
                      tables:
                        - name: events
                          columns:
                            event_name: TEXT
                            user_id: INTEGER
                            user_agent: TEXT
                            duration_ms: INTEGER
                            is_bot: BOOLEAN
                            coordinates: JSONB
                            timestamp: TEXT
                          rows:
                            - id: 5001
                              event_name: page_view
                              user_id: 1
                              user_agent: Mozilla/5.0
                              duration_ms: 3450
                              is_bot: false
                              coordinates:
                                latitude: 37.7749
                                longitude: -122.4194
                              timestamp: '2024-01-01T08:00:00Z'
                            - id: 5002
                              event_name: click
                              user_id: 2
                              user_agent: Chrome/120.0
                              is_bot: false
                              coordinates:
                                latitude: 40.7128
                                longitude: -74.006
                              timestamp: '2024-01-01T08:15:00Z'
                        - name: metrics
                          columns:
                            metric_name: TEXT
                            value: INTEGER
                            percentage: REAL
                            is_trending: BOOLEAN
                            change_rate: REAL
                            thresholds: JSONB
                            recorded_at: TEXT
                          rows:
                            - id: 1
                              metric_name: total_visits
                              value: 1250
                              is_trending: true
                              change_rate: 15.5
                              thresholds:
                                warning: 1000
                                critical: 500
                              recorded_at: '2024-01-01T00:00:00Z'
                            - id: 2
                              metric_name: bounce_rate
                              value: 35
                              percentage: 0.35
                              is_trending: false
                              change_rate: -2.3
                              thresholds:
                                warning: 50
                                critical: 70
                              recorded_at: '2024-01-01T00:00:00Z'
                            - id: 3
                              metric_name: avg_session_duration
                              value: 180
                              is_trending: true
                              change_rate: 8.7
                              thresholds:
                                warning: 120
                                critical: 60
                              recorded_at: '2024-01-01T00:00:00Z'
      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:
    SupabaseData-Input:
      properties:
        projects:
          items:
            $ref: '#/components/schemas/SupabaseProject'
          type: array
          title: Projects
          description: List of Supabase projects
      type: object
      title: SupabaseData
      description: Complete Supabase sandbox data structure
    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
    SupabaseProject:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Project ID (read-only, set by Supabase)
        name:
          type: string
          title: Name
          description: Project name
        tables:
          anyOf:
            - items:
                $ref: '#/components/schemas/SupabaseTable'
              type: array
            - type: 'null'
          title: Tables
          description: List of tables in the project
      type: object
      required:
        - name
      title: SupabaseProject
      description: Supabase Project 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
    SupabaseTable:
      properties:
        name:
          type: string
          title: Name
          description: Table name
        columns:
          additionalProperties:
            type: string
          type: object
          title: Columns
          description: Table schema mapping column names to types
        rows:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Rows
          description: Table data rows
      type: object
      required:
        - name
        - columns
      title: SupabaseTable
      description: Supabase Table object
  securitySchemes:
    HTTPBearer:
      type: http
      description: Your Klavis AI API key.
      scheme: bearer
      x-fern-bearer:
        name: api_key

````