Skip to main content
POST
/
sandbox
/
google_drive
/
{sandbox_id}
/
initialize
Initialize google_drive sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/google_drive/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "files": [
    {
      "name": "Project Documents",
      "mimeType": "application/vnd.google-apps.folder",
      "description": "Main folder for project documentation"
    },
    {
      "name": "Reports",
      "mimeType": "application/vnd.google-apps.folder",
      "description": "Quarterly and annual reports"
    },
    {
      "name": "Project Plan",
      "mimeType": "application/vnd.google-apps.document",
      "content": "# Project Plan\n\nThis is a comprehensive project plan document outlining goals, milestones, and deliverables.",
      "description": "Main project planning document"
    },
    {
      "name": "Meeting Notes",
      "mimeType": "application/vnd.google-apps.document",
      "content": "# Meeting Notes\n\n## 2025-01-15 - Kickoff Meeting\n- Discussed project scope\n- Assigned team roles\n- Set initial deadlines\n\n## 2025-02-01 - Progress Review\n- Reviewed Q1 deliverables\n- Adjusted timeline\n- Budget discussion",
      "description": "Team meeting notes and action items"
    },
    {
      "name": "Q1 Budget Report",
      "mimeType": "application/vnd.google-apps.document",
      "content": "# Q1 Budget Report\n\n## Summary\nTotal Budget: $250,000\nSpent: $180,000\nRemaining: $70,000\n\n## Breakdown\n- Personnel: $120,000\n- Infrastructure: $40,000\n- Marketing: $20,000",
      "description": "First quarter budget analysis"
    },
    {
      "name": "Team Roster",
      "mimeType": "application/vnd.google-apps.spreadsheet",
      "description": "Complete team member directory"
    },
    {
      "name": "Sales Dashboard 2025",
      "mimeType": "application/vnd.google-apps.spreadsheet",
      "description": "Real-time sales tracking and analytics"
    },
    {
      "name": "Product Presentation",
      "mimeType": "application/vnd.google-apps.presentation",
      "description": "Quarterly product showcase slides"
    },
    {
      "name": "README",
      "mimeType": "application/vnd.google-apps.document",
      "content": "# Welcome to the Project Workspace\n\nThis Drive contains all project-related documents, spreadsheets, and presentations.\n\n## Folder Structure\n- Project Documents: Planning and documentation\n- Reports: Quarterly reports and analytics\n\n## Getting Started\n1. Review the Project Plan\n2. Check Meeting Notes for latest updates\n3. Access shared resources in respective folders"
    },
    {
      "name": "Company Logo.png",
      "mimeType": "image/png",
      "description": "Official company logo file"
    }
  ]
}
'
import requests

url = "https://api.klavis.ai/sandbox/google_drive/{sandbox_id}/initialize"

payload = { "files": [
        {
            "name": "Project Documents",
            "mimeType": "application/vnd.google-apps.folder",
            "description": "Main folder for project documentation"
        },
        {
            "name": "Reports",
            "mimeType": "application/vnd.google-apps.folder",
            "description": "Quarterly and annual reports"
        },
        {
            "name": "Project Plan",
            "mimeType": "application/vnd.google-apps.document",
            "content": "# Project Plan

This is a comprehensive project plan document outlining goals, milestones, and deliverables.",
            "description": "Main project planning document"
        },
        {
            "name": "Meeting Notes",
            "mimeType": "application/vnd.google-apps.document",
            "content": "# Meeting Notes

## 2025-01-15 - Kickoff Meeting
- Discussed project scope
- Assigned team roles
- Set initial deadlines

## 2025-02-01 - Progress Review
- Reviewed Q1 deliverables
- Adjusted timeline
- Budget discussion",
            "description": "Team meeting notes and action items"
        },
        {
            "name": "Q1 Budget Report",
            "mimeType": "application/vnd.google-apps.document",
            "content": "# Q1 Budget Report

## Summary
Total Budget: $250,000
Spent: $180,000
Remaining: $70,000

## Breakdown
- Personnel: $120,000
- Infrastructure: $40,000
- Marketing: $20,000",
            "description": "First quarter budget analysis"
        },
        {
            "name": "Team Roster",
            "mimeType": "application/vnd.google-apps.spreadsheet",
            "description": "Complete team member directory"
        },
        {
            "name": "Sales Dashboard 2025",
            "mimeType": "application/vnd.google-apps.spreadsheet",
            "description": "Real-time sales tracking and analytics"
        },
        {
            "name": "Product Presentation",
            "mimeType": "application/vnd.google-apps.presentation",
            "description": "Quarterly product showcase slides"
        },
        {
            "name": "README",
            "mimeType": "application/vnd.google-apps.document",
            "content": "# Welcome to the Project Workspace

This Drive contains all project-related documents, spreadsheets, and presentations.

## Folder Structure
- Project Documents: Planning and documentation
- Reports: Quarterly reports and analytics

## Getting Started
1. Review the Project Plan
2. Check Meeting Notes for latest updates
3. Access shared resources in respective folders"
        },
        {
            "name": "Company Logo.png",
            "mimeType": "image/png",
            "description": "Official company logo file"
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    files: [
      {
        name: 'Project Documents',
        mimeType: 'application/vnd.google-apps.folder',
        description: 'Main folder for project documentation'
      },
      {
        name: 'Reports',
        mimeType: 'application/vnd.google-apps.folder',
        description: 'Quarterly and annual reports'
      },
      {
        name: 'Project Plan',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Project Plan\n\nThis is a comprehensive project plan document outlining goals, milestones, and deliverables.',
        description: 'Main project planning document'
      },
      {
        name: 'Meeting Notes',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Meeting Notes\n\n## 2025-01-15 - Kickoff Meeting\n- Discussed project scope\n- Assigned team roles\n- Set initial deadlines\n\n## 2025-02-01 - Progress Review\n- Reviewed Q1 deliverables\n- Adjusted timeline\n- Budget discussion',
        description: 'Team meeting notes and action items'
      },
      {
        name: 'Q1 Budget Report',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Q1 Budget Report\n\n## Summary\nTotal Budget: $250,000\nSpent: $180,000\nRemaining: $70,000\n\n## Breakdown\n- Personnel: $120,000\n- Infrastructure: $40,000\n- Marketing: $20,000',
        description: 'First quarter budget analysis'
      },
      {
        name: 'Team Roster',
        mimeType: 'application/vnd.google-apps.spreadsheet',
        description: 'Complete team member directory'
      },
      {
        name: 'Sales Dashboard 2025',
        mimeType: 'application/vnd.google-apps.spreadsheet',
        description: 'Real-time sales tracking and analytics'
      },
      {
        name: 'Product Presentation',
        mimeType: 'application/vnd.google-apps.presentation',
        description: 'Quarterly product showcase slides'
      },
      {
        name: 'README',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Welcome to the Project Workspace\n\nThis Drive contains all project-related documents, spreadsheets, and presentations.\n\n## Folder Structure\n- Project Documents: Planning and documentation\n- Reports: Quarterly reports and analytics\n\n## Getting Started\n1. Review the Project Plan\n2. Check Meeting Notes for latest updates\n3. Access shared resources in respective folders'
      },
      {
        name: 'Company Logo.png',
        mimeType: 'image/png',
        description: 'Official company logo file'
      }
    ]
  })
};

fetch('https://api.klavis.ai/sandbox/google_drive/{sandbox_id}/initialize', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    files: [
      {
        name: 'Project Documents',
        mimeType: 'application/vnd.google-apps.folder',
        description: 'Main folder for project documentation'
      },
      {
        name: 'Reports',
        mimeType: 'application/vnd.google-apps.folder',
        description: 'Quarterly and annual reports'
      },
      {
        name: 'Project Plan',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Project Plan\n\nThis is a comprehensive project plan document outlining goals, milestones, and deliverables.',
        description: 'Main project planning document'
      },
      {
        name: 'Meeting Notes',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Meeting Notes\n\n## 2025-01-15 - Kickoff Meeting\n- Discussed project scope\n- Assigned team roles\n- Set initial deadlines\n\n## 2025-02-01 - Progress Review\n- Reviewed Q1 deliverables\n- Adjusted timeline\n- Budget discussion',
        description: 'Team meeting notes and action items'
      },
      {
        name: 'Q1 Budget Report',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Q1 Budget Report\n\n## Summary\nTotal Budget: $250,000\nSpent: $180,000\nRemaining: $70,000\n\n## Breakdown\n- Personnel: $120,000\n- Infrastructure: $40,000\n- Marketing: $20,000',
        description: 'First quarter budget analysis'
      },
      {
        name: 'Team Roster',
        mimeType: 'application/vnd.google-apps.spreadsheet',
        description: 'Complete team member directory'
      },
      {
        name: 'Sales Dashboard 2025',
        mimeType: 'application/vnd.google-apps.spreadsheet',
        description: 'Real-time sales tracking and analytics'
      },
      {
        name: 'Product Presentation',
        mimeType: 'application/vnd.google-apps.presentation',
        description: 'Quarterly product showcase slides'
      },
      {
        name: 'README',
        mimeType: 'application/vnd.google-apps.document',
        content: '# Welcome to the Project Workspace\n\nThis Drive contains all project-related documents, spreadsheets, and presentations.\n\n## Folder Structure\n- Project Documents: Planning and documentation\n- Reports: Quarterly reports and analytics\n\n## Getting Started\n1. Review the Project Plan\n2. Check Meeting Notes for latest updates\n3. Access shared resources in respective folders'
      },
      {
        name: 'Company Logo.png',
        mimeType: 'image/png',
        description: 'Official company logo file'
      }
    ]
  })
};

fetch('https://api.klavis.ai/sandbox/google_drive/{sandbox_id}/initialize', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "sandbox_id": "<string>",
  "message": "<string>"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

Your Klavis AI API key.

Path Parameters

sandbox_id
string
required

The unique sandbox identifier

Query Parameters

init_default_data
boolean
default:false

If true, use default test data for initialization

Body

application/json

Complete Google Drive sandbox data structure

files
GoogleDriveFile · object[] | null

List of Google Drive files and folders

Response

Successful Response

Response model for sandbox initialization

sandbox_id
string
required

Sandbox identifier

status
enum<string>
required

Current status

Available options:
idle,
occupied,
error
message
string
required

Initialization result message