const createFolderStructure = async () => {
// Create main folder
const mainFolder = await fetch(
'https://api.vambe.ai/api/documents/assistant/folders',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your_api_key_here',
},
body: JSON.stringify({
name: 'Support Documentation',
icon: '📖',
}),
},
).then((r) => r.json());
// Create subfolders
const subfolder1 = await fetch(
'https://api.vambe.ai/api/documents/assistant/folders',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your_api_key_here',
},
body: JSON.stringify({
name: 'FAQs',
icon: '❓',
parent_folder_id: mainFolder.id,
}),
},
).then((r) => r.json());
const subfolder2 = await fetch(
'https://api.vambe.ai/api/documents/assistant/folders',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your_api_key_here',
},
body: JSON.stringify({
name: 'Troubleshooting',
icon: '🔧',
parent_folder_id: mainFolder.id,
}),
},
).then((r) => r.json());
console.log('Created folder structure:');
console.log(`- ${mainFolder.name}`);
console.log(` - ${subfolder1.name}`);
console.log(` - ${subfolder2.name}`);
return { mainFolder, subfolders: [subfolder1, subfolder2] };
};