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

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



## OpenAPI

````yaml post /sandbox/close/{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/close/{sandbox_id}/initialize:
    post:
      tags:
        - sandbox
      summary: Initialize close sandbox with data
      description: >-
        Initialize the sandbox with close-specific data following the defined
        schema.
      operationId: initialize_sandbox_sandbox_close__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/CloseData-Input'
                - type: 'null'
              title: Request Body
            examples:
              default:
                summary: Example initialization data
                value:
                  leads:
                    - name: CloudScale Technologies Inc.
                      status: Potential
                      contacts:
                        - name: Sarah Mitchell
                          emails:
                            - email: sarah.mitchell@cloudscale.tech
                              type: office
                              is_unsubscribed: false
                        - name: David Thompson
                          emails:
                            - email: dthompson@cloudscale.tech
                              type: office
                              is_unsubscribed: false
                      opportunities:
                        - note: >-
                            Annual SaaS subscription renewal - CloudScale
                            Technologies
                          value: 48000
                          confidence: 85
                          period: annual
                        - note: >-
                            Cloud infrastructure migration - CloudScale
                            expansion
                          value: 180000
                          confidence: 55
                          period: one_time
                      tasks:
                        - description: >-
                            Send proposal document to Sarah Mitchell at
                            CloudScale
                          date: '2025-12-02'
                          completed: false
                        - description: >-
                            Connect with decision maker David Thompson regarding
                            budget approval
                          date: '2025-12-03'
                          completed: false
                        - description: >-
                            Submit quarterly business review deck to CloudScale
                            Technologies
                          date: '2025-12-09'
                          completed: false
                    - name: DataFlow Analytics Corp
                      status: Potential
                      contacts:
                        - name: Michael Chen
                          emails:
                            - email: m.chen@dataflowanalytics.com
                              type: office
                              is_unsubscribed: false
                        - name: Jennifer Martinez
                          emails:
                            - email: jen.martinez@dataflowanalytics.com
                              type: office
                              is_unsubscribed: false
                      opportunities:
                        - note: >-
                            Enterprise data analytics platform implementation
                            for DataFlow
                          value: 125000
                          confidence: 60
                          period: one_time
                      tasks:
                        - description: >-
                            Schedule technical demo call with DataFlow Analytics
                            team
                          date: '2025-12-03'
                          completed: false
                        - description: >-
                            Send case studies and customer references to Michael
                            Chen
                          date: '2025-12-08'
                          completed: false
                        - description: >-
                            Follow up on security compliance questions from
                            Jennifer Martinez
                          date: '2025-12-06'
                          completed: false
                    - name: Phoenix Digital Marketing Agency
                      status: Potential
                      contacts:
                        - name: Emily Rodriguez
                          emails:
                            - email: emily.r@phoenixdigital.io
                              type: office
                              is_unsubscribed: false
                        - name: Robert Chang
                          emails:
                            - email: rchang@phoenixdigital.io
                              type: office
                              is_unsubscribed: false
                      opportunities:
                        - note: >-
                            Digital transformation consulting package - Phoenix
                            Digital
                          value: 75000
                          confidence: 70
                          period: one_time
                        - note: >-
                            Marketing automation platform upgrade - Phoenix
                            Digital
                          value: 28000
                          confidence: 90
                          period: monthly
                      tasks:
                        - description: Follow up on pricing questions from Emily Rodriguez
                          date: '2025-12-02'
                          completed: false
                        - description: >-
                            Schedule onboarding kickoff meeting with Phoenix
                            Digital
                          date: '2025-12-10'
                          completed: false
                    - name: Vertex Manufacturing Solutions
                      status: Potential
                      contacts:
                        - name: James Patterson
                          emails:
                            - email: j.patterson@vertexmfg.com
                              type: office
                              is_unsubscribed: false
                      opportunities:
                        - note: >-
                            ERP system integration and training - Vertex
                            Manufacturing
                          value: 95000
                          confidence: 45
                          period: one_time
                      tasks:
                        - description: >-
                            Review and finalize contract terms with Vertex
                            Manufacturing legal
                          date: '2025-12-05'
                          completed: false
                    - name: Lighthouse Financial Advisors
                      status: Potential
                      contacts:
                        - name: Alexandra Kim
                          emails:
                            - email: alex.kim@lighthousefa.com
                              type: office
                              is_unsubscribed: false
                      opportunities:
                        - note: Financial planning software suite - Lighthouse FA
                          value: 32000
                          confidence: 80
                          period: annual
                      tasks:
                        - description: >-
                            Prepare ROI analysis for Lighthouse Financial
                            Advisors
                          date: '2025-12-04'
                          completed: false
      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:
    CloseData-Input:
      properties:
        leads:
          anyOf:
            - items:
                $ref: '#/components/schemas/CloseLead-Input'
              type: array
            - type: 'null'
          title: Leads
          description: List of leads with nested objects
      type: object
      title: CloseData
      description: |-
        Complete Close sandbox data structure.

        Nested hierarchy for initialization:
        - Leads contain Contacts, Opportunities, and Tasks
    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
    CloseLead-Input:
      properties:
        name:
          type: string
          title: Name
          description: Lead name/company name
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Lead status
        contacts:
          anyOf:
            - items:
                $ref: '#/components/schemas/CloseContact-Input'
              type: array
            - type: 'null'
          title: Contacts
          description: Contacts associated with this lead
        opportunities:
          anyOf:
            - items:
                $ref: '#/components/schemas/CloseOpportunity-Input'
              type: array
            - type: 'null'
          title: Opportunities
          description: Opportunities associated with this lead
        tasks:
          anyOf:
            - items:
                $ref: '#/components/schemas/CloseTask-Input'
              type: array
            - type: 'null'
          title: Tasks
          description: Tasks associated with this lead
      type: object
      required:
        - name
      title: CloseLead
      description: >-
        Close Lead object - parent object containing contacts, opportunities,
        and tasks
    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
    CloseContact-Input:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Contact full name
        emails:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Emails
          description: List of email objects
        phones:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Phones
          description: List of phone objects
      type: object
      title: CloseContact
      description: Close Contact object - child of Lead
    CloseOpportunity-Input:
      properties:
        note:
          type: string
          title: Note
          description: Opportunity note/description
        value:
          anyOf:
            - type: integer
            - type: 'null'
          title: Value
          description: Opportunity value in cents
        confidence:
          anyOf:
            - type: integer
            - type: 'null'
          title: Confidence
          description: Confidence percentage (0-100)
        period:
          anyOf:
            - type: string
            - type: 'null'
          title: Period
          description: Billing period (e.g., 'one_time', 'monthly', 'annual')
      type: object
      required:
        - note
      title: CloseOpportunity
      description: Close Opportunity object - child of Lead
    CloseTask-Input:
      properties:
        description:
          type: string
          title: Description
          description: Task description
        date:
          anyOf:
            - type: string
            - type: 'null'
          title: Date
          description: The date when the task is actionable
        completed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Completed
          description: Whether task is completed
        assignee_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee Id
          description: User ID assigned to
      type: object
      required:
        - description
      title: CloseTask
      description: Close Task object - child of Lead
  securitySchemes:
    HTTPBearer:
      type: http
      description: Your Klavis AI API key.
      scheme: bearer
      x-fern-bearer:
        name: api_key

````