Skip to main content
POST
/
sandbox
/
onedrive
/
{sandbox_id}
/
initialize
Initialize onedrive sandbox with data
curl --request POST \
  --url https://api.klavis.ai/sandbox/onedrive/{sandbox_id}/initialize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "root": [
    {
      "name": "root",
      "folders": [
        {
          "name": "Documents",
          "files": [
            {
              "name": "readme.txt",
              "content": "Welcome to the Documents folder. This contains important project documentation."
            },
            {
              "name": "notes.txt",
              "content": "Meeting notes from January 2024.\n- Discussed Q1 goals\n- Reviewed project timeline"
            }
          ],
          "folders": [
            {
              "name": "Projects",
              "files": [
                {
                  "name": "project_summary.txt",
                  "content": "Project Alpha Summary\nStatus: In Progress\nDeadline: March 2024"
                }
              ],
              "folders": [
                {
                  "name": "ProjectAlpha",
                  "files": [
                    {
                      "name": "requirements.txt",
                      "content": "Project Alpha Requirements:\n1. User authentication\n2. Dashboard implementation\n3. API integration"
                    },
                    {
                      "name": "tasks.txt",
                      "content": "TODO:\n- Complete backend API\n- Design frontend mockups\n- Write unit tests"
                    }
                  ],
                  "folders": []
                }
              ]
            }
          ]
        },
        {
          "name": "Work",
          "files": [
            {
              "name": "schedule.txt",
              "content": "Work Schedule - Week of Jan 15\nMonday: Team meeting 10am\nWednesday: Client presentation 2pm\nFriday: Sprint review 3pm"
            }
          ],
          "folders": [
            {
              "name": "Reports",
              "files": [
                {
                  "name": "weekly_report.txt",
                  "content": "Weekly Report - Week 3\nCompleted: 8 tasks\nIn Progress: 3 tasks\nBlocked: 1 task"
                }
              ],
              "folders": [
                {
                  "name": "Q1_2024",
                  "files": [
                    {
                      "name": "january.txt",
                      "content": "January Report:\nRevenue: $50,000\nNew Clients: 5\nProjects Completed: 3"
                    },
                    {
                      "name": "february.txt",
                      "content": "February Report:\nRevenue: $55,000\nNew Clients: 7\nProjects Completed: 4"
                    }
                  ],
                  "folders": []
                }
              ]
            }
          ]
        }
      ],
      "files": [
        {
          "name": "welcome.txt",
          "content": "Welcome to your OneDrive!\nThis is your personal cloud storage space."
        }
      ]
    }
  ]
}
'
import requests

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

payload = { "root": [
{
"name": "root",
"folders": [
{
"name": "Documents",
"files": [
{
"name": "readme.txt",
"content": "Welcome to the Documents folder. This contains important project documentation."
},
{
"name": "notes.txt",
"content": "Meeting notes from January 2024.
- Discussed Q1 goals
- Reviewed project timeline"
}
],
"folders": [
{
"name": "Projects",
"files": [
{
"name": "project_summary.txt",
"content": "Project Alpha Summary
Status: In Progress
Deadline: March 2024"
}
],
"folders": [
{
"name": "ProjectAlpha",
"files": [
{
"name": "requirements.txt",
"content": "Project Alpha Requirements:
1. User authentication
2. Dashboard implementation
3. API integration"
},
{
"name": "tasks.txt",
"content": "TODO:
- Complete backend API
- Design frontend mockups
- Write unit tests"
}
],
"folders": []
}
]
}
]
},
{
"name": "Work",
"files": [
{
"name": "schedule.txt",
"content": "Work Schedule - Week of Jan 15
Monday: Team meeting 10am
Wednesday: Client presentation 2pm
Friday: Sprint review 3pm"
}
],
"folders": [
{
"name": "Reports",
"files": [
{
"name": "weekly_report.txt",
"content": "Weekly Report - Week 3
Completed: 8 tasks
In Progress: 3 tasks
Blocked: 1 task"
}
],
"folders": [
{
"name": "Q1_2024",
"files": [
{
"name": "january.txt",
"content": "January Report:
Revenue: $50,000
New Clients: 5
Projects Completed: 3"
},
{
"name": "february.txt",
"content": "February Report:
Revenue: $55,000
New Clients: 7
Projects Completed: 4"
}
],
"folders": []
}
]
}
]
}
],
"files": [
{
"name": "welcome.txt",
"content": "Welcome to your OneDrive!
This is your personal cloud storage space."
}
]
}
] }
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({
root: [
{
name: 'root',
folders: [
{
name: 'Documents',
files: [
{
name: 'readme.txt',
content: 'Welcome to the Documents folder. This contains important project documentation.'
},
{
name: 'notes.txt',
content: 'Meeting notes from January 2024.\n- Discussed Q1 goals\n- Reviewed project timeline'
}
],
folders: [
{
name: 'Projects',
files: [
{
name: 'project_summary.txt',
content: 'Project Alpha Summary\nStatus: In Progress\nDeadline: March 2024'
}
],
folders: [
{
name: 'ProjectAlpha',
files: [
{
name: 'requirements.txt',
content: 'Project Alpha Requirements:\n1. User authentication\n2. Dashboard implementation\n3. API integration'
},
{
name: 'tasks.txt',
content: 'TODO:\n- Complete backend API\n- Design frontend mockups\n- Write unit tests'
}
],
folders: []
}
]
}
]
},
{
name: 'Work',
files: [
{
name: 'schedule.txt',
content: 'Work Schedule - Week of Jan 15\nMonday: Team meeting 10am\nWednesday: Client presentation 2pm\nFriday: Sprint review 3pm'
}
],
folders: [
{
name: 'Reports',
files: [
{
name: 'weekly_report.txt',
content: 'Weekly Report - Week 3\nCompleted: 8 tasks\nIn Progress: 3 tasks\nBlocked: 1 task'
}
],
folders: [
{
name: 'Q1_2024',
files: [
{
name: 'january.txt',
content: 'January Report:\nRevenue: $50,000\nNew Clients: 5\nProjects Completed: 3'
},
{
name: 'february.txt',
content: 'February Report:\nRevenue: $55,000\nNew Clients: 7\nProjects Completed: 4'
}
],
folders: []
}
]
}
]
}
],
files: [
{
name: 'welcome.txt',
content: 'Welcome to your OneDrive!\nThis is your personal cloud storage space.'
}
]
}
]
})
};

fetch('https://api.klavis.ai/sandbox/onedrive/{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({
root: [
{
name: 'root',
folders: [
{
name: 'Documents',
files: [
{
name: 'readme.txt',
content: 'Welcome to the Documents folder. This contains important project documentation.'
},
{
name: 'notes.txt',
content: 'Meeting notes from January 2024.\n- Discussed Q1 goals\n- Reviewed project timeline'
}
],
folders: [
{
name: 'Projects',
files: [
{
name: 'project_summary.txt',
content: 'Project Alpha Summary\nStatus: In Progress\nDeadline: March 2024'
}
],
folders: [
{
name: 'ProjectAlpha',
files: [
{
name: 'requirements.txt',
content: 'Project Alpha Requirements:\n1. User authentication\n2. Dashboard implementation\n3. API integration'
},
{
name: 'tasks.txt',
content: 'TODO:\n- Complete backend API\n- Design frontend mockups\n- Write unit tests'
}
],
folders: []
}
]
}
]
},
{
name: 'Work',
files: [
{
name: 'schedule.txt',
content: 'Work Schedule - Week of Jan 15\nMonday: Team meeting 10am\nWednesday: Client presentation 2pm\nFriday: Sprint review 3pm'
}
],
folders: [
{
name: 'Reports',
files: [
{
name: 'weekly_report.txt',
content: 'Weekly Report - Week 3\nCompleted: 8 tasks\nIn Progress: 3 tasks\nBlocked: 1 task'
}
],
folders: [
{
name: 'Q1_2024',
files: [
{
name: 'january.txt',
content: 'January Report:\nRevenue: $50,000\nNew Clients: 5\nProjects Completed: 3'
},
{
name: 'february.txt',
content: 'February Report:\nRevenue: $55,000\nNew Clients: 7\nProjects Completed: 4'
}
],
folders: []
}
]
}
]
}
],
files: [
{
name: 'welcome.txt',
content: 'Welcome to your OneDrive!\nThis is your personal cloud storage space.'
}
]
}
]
})
};

fetch('https://api.klavis.ai/sandbox/onedrive/{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 OneDrive sandbox data structure

root
OneDriveFolder · object[]
required

List containing root folder (should contain only one element)

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