> ## Documentation Index
> Fetch the complete documentation index at: https://www.studyfetch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Working with Folders

> Organize your materials into folders for better management

## Overview

Folders help you organize materials into logical groups. You can:

* Create folders and subfolders
* Move materials between folders
* Delete folders
* List folder contents
* Create nested folder structures

## Folder Object

```json theme={null}
{
  "_id": "folder_123abc",
  "name": "Biology Notes",
  "organizationId": "org_456def",
  "parentFolderId": null, // null for root folders
  "materialCount": 15,
  "subfolderCount": 3,
  "path": "/Biology Notes",
  "status": "active",
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:00:00Z"
}
```

## Create Folder

Create a new folder to organize your materials.

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Create a root folder
  const folder = await client.v1.folders.create({
    name: 'Biology Course',
    parentFolderId: undefined // Optional, null for root folder
  });

  // Create a subfolder
  const subfolder = await client.v1.folders.create({
    name: 'Chapter 1 - Cell Structure',
    parentFolderId: folder._id
  });

  console.log('Folder created:', folder._id);
  console.log('Subfolder created:', subfolder._id);
  ```

  ```python Python theme={null}
  # Create a root folder
  folder = client.v1.folders.create(
      name="Biology Course",
      parent_id=None  # Optional, None for root folder
  )

  # Create a subfolder
  subfolder = client.v1.folders.create(
      name="Chapter 1 - Cell Structure",
      parent_id=folder._id
  )

  print(f"Folder created: {folder._id}")
  print(f"Subfolder path: {subfolder.path}")
  ```

  ```java Java theme={null}
  import com.studyfetch.javasdk.models.v1.folders.FolderCreateParams;

  // Create a root folder
  FolderCreateResponse folder = client.v1().folders().create(
      FolderCreateParams.builder()
          .name("Biology Course")
          // Don't set parentFolderId for root folder - it defaults to Optional.empty()
          .build()
  );

  // Create a subfolder
  FolderCreateResponse subfolder = client.v1().folders().create(
      FolderCreateParams.builder()
          .name("Chapter 1 - Cell Structure")
          .parentFolderId(folder._id())
          .build()
  );

  System.out.println("Folder created: " + folder._id());
  System.out.println("Subfolder created: " + subfolder._id());
  ```

  ```csharp C# theme={null}
  using StudyfetchSDK;
  using StudyfetchSDK.Models.V1.Folders;
  using System;
  using System.Threading.Tasks;

  public class CreateFolder
  {
      public static async Task CreateFolders()
      {
          var client = new StudyfetchSDKClient()
          {
              APIKey = Environment.GetEnvironmentVariable("STUDYFETCH_API_KEY"),
              BaseUrl = new Uri("https://studyfetchapi.com")
          };

          // Create a root folder
          var folder = await client.V1.Folders.Create(new()
          {
              Name = "Biology Course",
              ParentFolderID = null // Optional, null for root folder
          });

          // Create a subfolder
          var subfolder = await client.V1.Folders.Create(new()
          {
              Name = "Chapter 1 - Cell Structure",
              ParentFolderID = folder._ID
          });

          Console.WriteLine($"Folder created: {folder._ID}");
          Console.WriteLine($"Subfolder path: {subfolder.ParentFolderID}");
      }
  }
  ```
</CodeGroup>

## List All Folders

Get all folders in your organization.

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Get all folders
  const folders = await client.v1.folders.list();

  // Get only root folders
  const rootFolders = await client.v1.folders.list({
    parentFolderId: undefined
  });

  // Get subfolders of a specific folder
  const subfolders = await client.v1.folders.list({
    parentFolderId: 'folder_123abc'
  });

  console.log(`Found ${folders.length} total folders`);
  ```

  ```python Python theme={null}
  # Get all folders
  folders = client.v1.folders.list()

  # Get only root folders
  root_folders = client.v1.folders.list(
      parent_folder_id=None
  )

  # Get subfolders of a specific folder
  subfolders = client.v1.folders.list(
      parent_folder_id="folder_123abc"
  )

  print(f"Found {len(folders)} total folders")
  ```

  ```java Java theme={null}
  import com.studyfetch.javasdk.models.v1.folders.FolderListParams;
  import com.studyfetch.javasdk.models.v1.folders.FolderListResponse;
  import java.util.List;

  // Get all folders
  List<FolderListResponse> folders = client.v1().folders().list(
      FolderListParams.builder()
          .build()
  );

  // Get only root folders (don't set parentFolderId)
  List<FolderListResponse> rootFolders = client.v1().folders().list(
      FolderListParams.builder()
          // Don't set parentFolderId to get root folders
          .build()
  );

  // Get subfolders of a specific folder
  List<FolderListResponse> subfolders = client.v1().folders().list(
      FolderListParams.builder()
          .parentFolderId("folder_123abc")
          .build()
  );

  System.out.println("Found " + folders.size() + " total folders");
  ```

  ```csharp C# theme={null}
  using StudyfetchSDK;
  using StudyfetchSDK.Models.V1.Folders;
  using System;
  using System.Threading.Tasks;
  using System.Text.Json;

  public class ListFolders
  {
      public static async Task ListAllFolders()
      {
          var client = new StudyfetchSDKClient()
          {
              APIKey = Environment.GetEnvironmentVariable("STUDYFETCH_API_KEY"),
              BaseUrl = new Uri("https://studyfetchapi.com")
          };

          // Get all folders
          var folders = await client.V1.Folders.List(new());

          // Get only root folders
          var rootFolders = await client.V1.Folders.List(new()
          {
              ParentFolderID = null
          });

          // Get subfolders of a specific folder
          var subfolders = await client.V1.Folders.List(new()
          {
              ParentFolderID = "folder_123abc"
          });

          Console.WriteLine($"Found {folders.Count} total folders");
      }
  }
  ```
</CodeGroup>

## Get Folder Details

Retrieve details about a specific folder including material and subfolder counts.

<CodeGroup>
  ```javascript JavaScript theme={null}
  const folder = await client.v1.folders.retrieve('folder_123abc');

  console.log('Folder name:', folder.name);
  console.log('Materials:', folder.materialCount);
  console.log('Subfolders:', folder.subfolders.length);
  console.log('Parent folder:', folder.parentFolderId || 'root');
  ```

  ```python Python theme={null}
  folder = client.v1.folders.retrieve("folder_123abc")

  print(f"Folder name: {folder.name}")
  print(f"Materials: {folder.material_count}")
  print(f"Subfolders: {folder.subfolder_count}")
  print(f"Path: {folder.path}")
  ```

  ```java Java theme={null}
  import com.studyfetch.javasdk.models.v1.folders.FolderRetrieveParams;
  import com.studyfetch.javasdk.models.v1.folders.FolderRetrieveResponse;

  FolderRetrieveResponse folder = client.v1().folders().retrieve(
      FolderRetrieveParams.builder()
          .id("folder_123abc")
          .build()
  );

  System.out.println("Folder name: " + folder.name());
  System.out.println("Materials: " + folder.materialCount());
  System.out.println("Subfolders: " + folder.subfolders().size());
  System.out.println("Parent folder: " + folder.parentFolderId().orElse("root"));
  ```

  ```csharp C# theme={null}
  using StudyfetchSDK;
  using StudyfetchSDK.Models.V1.Folders;
  using System;
  using System.Threading.Tasks;

  public class GetFolderDetails
  {
      public static async Task GetFolder()
      {
          var client = new StudyfetchSDKClient()
          {
              APIKey = Environment.GetEnvironmentVariable("STUDYFETCH_API_KEY"),
              BaseUrl = new Uri("https://studyfetchapi.com")
          };

          var folder = await client.V1.Folders.Retrieve(new()
          {
              ID = "folder_123abc"
          });

          Console.WriteLine($"Folder name: {folder.Name}");
          Console.WriteLine($"Materials: {folder.MaterialCount}");
          Console.WriteLine($"Subfolders: {folder.Subfolders}");
          Console.WriteLine($"Path: {folder.ParentFolderID}");
      }
  }
  ```
</CodeGroup>

## Move Folder

Move a folder to a different parent folder or to the root level.

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Move to another folder
  const movedFolder = await client.v1.folders.move('folder_123abc', {
    parentFolderId: 'folder_456def'
  });

  // Move to root level
  const rootFolder = await client.v1.folders.move('folder_123abc', {
    parentFolderId: null
  });

  console.log('Folder moved to:', movedFolder.parentFolderId || 'root');
  ```

  ```python Python theme={null}
  # Move to another folder
  moved_folder = client.v1.folders.move(
      folder_id="folder_123abc",
      parent_folder_id="folder_456def"
  )

  # Move to root level
  root_folder = client.v1.folders.move(
      folder_id="folder_123abc",
      parent_folder_id=None
  )

  print(f"Folder moved to: {moved_folder.path}")
  ```

  ```java Java theme={null}
  import com.studyfetch.javasdk.models.v1.folders.FolderMoveParams;

  // Move to another folder
  FolderMoveResponse movedFolder = client.v1().folders().move(
      FolderMoveParams.builder()
          .id("folder_123abc")
          .parentFolderId("folder_456def")
          .build()
  );

  // Move to root level
  FolderMoveResponse rootFolder = client.v1().folders().move(
      FolderMoveParams.builder()
          .id("folder_123abc")
          // Don't set parentFolderId to move to root
          .build()
  );

  System.out.println("Folder moved to: " + movedFolder.parentFolderId().orElse("root"));
  ```

  ```csharp C# theme={null}
  using StudyfetchSDK;
  using StudyfetchSDK.Models.V1.Folders;
  using System;
  using System.Threading.Tasks;

  public class MoveFolder
  {
      public static async Task Move()
      {
          var client = new StudyfetchSDKClient()
          {
              APIKey = Environment.GetEnvironmentVariable("STUDYFETCH_API_KEY"),
              BaseUrl = new Uri("https://studyfetchapi.com")
          };

          // Move to another folder
          var movedFolder = await client.V1.Folders.Move(new()
          {
              ID = "folder_123abc",
              ParentFolderID = "folder_456def"
          });

          // Move to root level
          var rootFolder = await client.V1.Folders.Move(new()
          {
              ID = "folder_123abc",
              ParentFolderID = null
          });

          Console.WriteLine($"Folder moved to: {movedFolder.ParentFolderID ?? "root"}");
      }
  }
  ```
</CodeGroup>

## Delete Folder

Delete a folder from your organization.

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Delete folder and move materials to another folder
  await client.v1.folders.delete('folder_123abc');

  console.log('Folder deleted successfully');
  ```

  ```python Python theme={null}
  # Delete folder
  client.v1.folders.delete(
      folder_id="folder_123abc"
  )

  print("Folder deleted successfully")
  ```

  ```java Java theme={null}
  import com.studyfetch.javasdk.models.v1.folders.FolderDeleteParams;

  // Delete folder
  client.v1().folders().delete(
      FolderDeleteParams.builder()
          .id("folder_123abc")
          .build()
  );

  System.out.println("Folder deleted successfully");
  ```

  ```csharp C# theme={null}
  using StudyfetchSDK;
  using StudyfetchSDK.Models.V1.Folders;
  using System;
  using System.Threading.Tasks;

  public class DeleteFolder
  {
      public static async Task Delete()
      {
          var client = new StudyfetchSDKClient()
          {
              APIKey = Environment.GetEnvironmentVariable("STUDYFETCH_API_KEY"),
              BaseUrl = new Uri("https://studyfetchapi.com")
          };

          // Delete folder
          await client.V1.Folders.Delete(new()
          {
              ID = "folder_123abc"
          });

          Console.WriteLine("Folder deleted successfully");
      }
  }
  ```
</CodeGroup>

## Get Folder Contents

List all materials in a specific folder.

### Using materials.list()

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Get materials in a folder with pagination
  const materials = await client.v1.materials.list({
    folderId: 'folder_123abc',
    limit: '20',
    page: '1'
  });

  console.log(`Folder contains ${materials.materials?.length || 0} materials`);
  console.log(`Total in folder: ${materials.totalCount}`);

  // Display material names
  materials.materials?.forEach(material => {
    console.log(`- ${material.name} (${material.contentType})`);
  });
  ```

  ```python Python theme={null}
  # Get materials in a folder with pagination
  materials = client.v1.materials.list(
      folder_id="folder_123abc",
      limit="20",
      page="1"
  )

  print(f"Folder contains {len(materials.data)} materials")
  print(f"Total in folder: {materials.total}")

  # Display material names
  for material in materials.data:
      print(f"- {material.name} ({material.content_type})")
  ```

  ```java Java theme={null}
  // Get materials in a folder with pagination
  MaterialListParams params = MaterialListParams.builder()
      .folderId("folder_123abc")
      .limit("20")
      .page("1")
      .build();
  MaterialListResponse materials = client.v1().materials().list(params);

  System.out.println("Folder contains " + materials.materials().orElse(Collections.emptyList()).size() + " materials");
  System.out.println("Total in folder: " + materials.totalCount().orElse(0.0));

  // Display material names
  for (MaterialResponse material : materials.materials().orElse(Collections.emptyList())) {
      System.out.println("- " + material.name() + 
          " (" + material.contentType() + ")");
  }
  ```

  ```csharp C# theme={null}
  using StudyfetchSDK;
  using StudyfetchSDK.Models.V1.Materials;
  using System;
  using System.Threading.Tasks;

  public class GetFolderContents
  {
      public static async Task ListMaterialsInFolder()
      {
          var client = new StudyfetchSDKClient()
          {
              APIKey = Environment.GetEnvironmentVariable("STUDYFETCH_API_KEY"),
              BaseUrl = new Uri("https://studyfetchapi.com")
          };

          // Get materials in a folder with pagination
          var materials = await client.V1.Materials.List(new()
          {
              FolderID = "folder_123abc",
              Limit = "20",
              Page = "1"
          });

          Console.WriteLine($"Folder contains {materials.Materials?.Count ?? 0} materials");
          Console.WriteLine($"Total in folder: {materials.TotalCount}");

          // Display material names
          foreach (var material in materials.Materials ?? [])
          {
              Console.WriteLine($"- {material.Name} ({material.ContentType})");
          }
      }
  }
  ```
</CodeGroup>

### Using folders.listMaterials()

Alternatively, you can use the `folders.listMaterials()` method to get materials directly from a folder with pagination support.

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Get materials using folders.listMaterials() with pagination
  const folderMaterials = await client.v1.folders.listMaterials(
    'folder_123abc',
    {
      limit: '20',
      page: '1'
    }
  );

  console.log(`Found ${folderMaterials.materials?.length || 0} materials`);
  console.log(`Total: ${folderMaterials.totalCount}`);
  console.log(`Page ${folderMaterials.page} of ${folderMaterials.totalPages}`);

  // Iterate through all pages
  if (folderMaterials.totalPages && folderMaterials.totalPages > 1) {
    for (let page = 2; page <= folderMaterials.totalPages; page++) {
      const nextPage = await client.v1.folders.listMaterials(
        'folder_123abc',
        { limit: '20', page: page.toString() }
      );
      console.log(`Page ${page}: ${nextPage.materials?.length || 0} materials`);
    }
  }
  ```

  ```python Python theme={null}
  # Get materials using folders.list_materials() with pagination
  folder_materials = client.v1.folders.list_materials(
      "folder_123abc",
      limit="20",
      page="1"
  )

  print(f"Found {len(folder_materials.data)} materials")
  print(f"Total: {folder_materials.total}")
  print(f"Page {folder_materials.page} of {folder_materials.total_pages}")

  # Iterate through all pages
  for page in range(2, folder_materials.total_pages + 1):
      next_page = client.v1.folders.list_materials(
          "folder_123abc",
          limit="20",
          page=str(page)
      )
      print(f"Page {page}: {len(next_page.data)} materials")
  ```

  ```java Java theme={null}
  import com.studyfetch.javasdk.models.v1.folders.FolderListMaterialsParams;
  import com.studyfetch.javasdk.models.v1.folders.FolderListMaterialsResponse;
  import java.util.Collections;

  // Get materials using folders.listMaterials() with pagination
  FolderListMaterialsParams params = FolderListMaterialsParams.builder()
      .id("folder_123abc")
      .limit("20")
      .page("1")
      .build();
  FolderListMaterialsResponse folderMaterials = client.v1().folders()
      .listMaterials(params);

  System.out.println("Found " + folderMaterials.materials().orElse(Collections.emptyList()).size() + " materials");
  System.out.println("Total: " + folderMaterials.totalCount().orElse(0.0));
  System.out.println("Page " + folderMaterials.page().orElse(0.0) + " of " + 
      folderMaterials.totalPages().orElse(0.0));

  // Iterate through all pages
  if (folderMaterials.totalPages().isPresent() && folderMaterials.totalPages().get() > 1) {
      for (int page = 2; page <= folderMaterials.totalPages().get(); page++) {
          FolderListMaterialsParams nextParams = FolderListMaterialsParams.builder()
              .id("folder_123abc")
              .limit("20")
              .page(String.valueOf(page))
              .build();
          FolderListMaterialsResponse nextPage = client.v1().folders()
              .listMaterials(nextParams);
          System.out.println("Page " + page + ": " + nextPage.materials().orElse(Collections.emptyList()).size() + " materials");
      }
  }
  ```

  ```csharp C# theme={null}
  // Get materials using folders.ListMaterials() with pagination
  var folderMaterials = await client.V1.Folders.ListMaterials(new()
  {
      ID = "folder_123abc"
  });

  Console.WriteLine($"Found {folderMaterials.Materials?.Count ?? 0} materials");

  // Display material names
  foreach (var material in folderMaterials.Materials ?? [])
  {
      Console.WriteLine($"- {material.Name} ({material._ID})");
  }
  ```
</CodeGroup>

## Example: Complete Folder Organization

Here's a complete example of organizing course materials:

<CodeGroup>
  ```javascript JavaScript theme={null}
  // 1. Create main course folder
  const courseFolder = await client.v1.folders.create({
    name: 'Biology 101'
  });

  // 2. Create chapter folders
  const chapter1 = await client.v1.folders.create({
    name: 'Chapter 1 - Cells',
    parentFolderId: courseFolder._id
  });

  const chapter2 = await client.v1.folders.create({
    name: 'Chapter 2 - Genetics',
    parentFolderId: courseFolder._id
  });

  // 3. Upload materials to specific folders
  const fileBuffer = await fs.promises.readFile(
    path.join(process.cwd(), 'cell-structure.pdf'),
  );
  const file = new File([fileBuffer], 'cell-structure.pdf', {
    type: 'application/pdf',
  });

  const material = await client.v1.materials.upload.uploadFile({
    file,
    name: 'Cell Structure Notes',
    folderId: chapter1._id
  });

  // 4. List folder structure
  const subfolders = await client.v1.folders.list({
    parentFolderId: courseFolder._id
  });

  console.log(`Course folder: ${courseFolder.name}`);
  subfolders.forEach(folder => {
    console.log(`  └─ ${folder.name}`);
  });

  // 5. Get materials in chapter 1 with pagination
  const chapter1Materials = await client.v1.materials.list({
    folderId: chapter1._id,
    limit: '20',
    page: '1'
  });

  console.log(`\nChapter 1 materials: ${chapter1Materials.materials?.length || 0}`);
  console.log(`Total in chapter: ${chapter1Materials.totalCount}`);

  // Get next page if needed
  if (chapter1Materials.totalPages && chapter1Materials.totalPages > 1) {
    const page2 = await client.v1.materials.list({
      folderId: chapter1._id,
      limit: '20',
      page: '2'
    });
    console.log(`Page 2 contains ${page2.materials?.length || 0} more materials`);
  }
  ```

  ```python Python theme={null}
  # 1. Create main course folder
  course_folder = client.v1.folders.create(
      name="Biology 101"
  )

  # 2. Create chapter folders
  chapter1 = client.v1.folders.create(
      name="Chapter 1 - Cells",
      parent_folder_id=course_folder._id
  )

  chapter2 = client.v1.folders.create(
      name="Chapter 2 - Genetics",
      parent_folder_id=course_folder._id
  )

  # 3. Upload materials to specific folders
  with open('cell-structure.pdf', 'rb') as file:
      material = client.v1.materials.upload(
          file=file,
          name="Cell Structure Notes",
          folder_id=chapter1._id
      )

  # 4. List folder structure
  subfolders = client.v1.folders.list(
      parent_folder_id=course_folder._id
  )

  print(f"Course folder: {course_folder.name}")
  for folder in subfolders:
      print(f"  └─ {folder.name}")

  # 5. Get materials in chapter 1
  chapter1_materials = client.v1.materials.list(
      folder_id=chapter1._id
  )

  print(f"\nChapter 1 materials: {len(chapter1_materials)}")
  ```

  ```java Java theme={null}
  import com.studyfetch.javasdk.models.v1.folders.FolderCreateParams;
  import com.studyfetch.javasdk.models.v1.folders.FolderCreateResponse;
  import com.studyfetch.javasdk.models.v1.folders.FolderListParams;
  import com.studyfetch.javasdk.models.v1.folders.FolderListResponse;
  import com.studyfetch.javasdk.models.v1.materials.MaterialListParams;
  import com.studyfetch.javasdk.models.v1.materials.MaterialListResponse;
  import com.studyfetch.javasdk.models.v1.materials.MaterialResponse;
  import com.studyfetch.javasdk.models.v1.materials.upload.UploadUploadFileParams;
  import java.io.File;
  import java.io.FileInputStream;
  import java.util.Collections;
  import java.util.List;

  // 1. Create main course folder
  FolderCreateResponse courseFolder = client.v1().folders().create(
      FolderCreateParams.builder()
          .name("Biology 101")
          // Don't set parentFolderId for root folder
          .build()
  );

  // 2. Create chapter folders
  FolderCreateResponse chapter1 = client.v1().folders().create(
      FolderCreateParams.builder()
          .name("Chapter 1 - Cells")
          .parentFolderId(courseFolder._id())
          .build()
  );

  FolderCreateResponse chapter2 = client.v1().folders().create(
      FolderCreateParams.builder()
          .name("Chapter 2 - Genetics")
          .parentFolderId(courseFolder._id())
          .build()
  );

  // 3. Upload materials to specific folders
  File file = new File("cell-structure.pdf");
  UploadUploadFileParams uploadParams = UploadUploadFileParams.builder()
      .file(new FileInputStream(file))
      .name("Cell Structure Notes")
      .folderId(chapter1._id())
      .build();
  MaterialResponse material = client.v1().materials().upload().uploadFile(uploadParams);

  // 4. List folder structure
  FolderListParams params = FolderListParams.builder()
      .parentFolderId(courseFolder._id())
      .build();
  List<FolderListResponse> subfolders = client.v1().folders().list(params);

  System.out.println("Course folder: " + courseFolder.name());
  for (FolderListResponse folder : subfolders) {
      System.out.println("  └─ " + folder.name());
  }

  // 5. Get materials in chapter 1
  MaterialListParams matParams = MaterialListParams.builder()
      .folderId(chapter1._id())
      .build();
  MaterialListResponse chapter1Materials = client.v1().materials()
      .list(matParams);

  System.out.println("\nChapter 1 materials: " + 
      chapter1Materials.materials().orElse(Collections.emptyList()).size());
  ```

  ```csharp C# theme={null}
  using StudyfetchSDK;
  using StudyfetchSDK.Models.V1.Folders;
  using StudyfetchSDK.Models.V1.Materials;
  using System;
  using System.IO;
  using System.Collections.Generic;
  using System.Threading.Tasks;
  using System.Text.Json;

  public class CompleteFolderOrganization
  {
      public static async Task OrganizeMaterials()
      {
          var client = new StudyfetchSDKClient()
          {
              APIKey = Environment.GetEnvironmentVariable("STUDYFETCH_API_KEY"),
              BaseUrl = new Uri("https://studyfetchapi.com")
          };

          // 1. Create main course folder
          var courseFolder = await client.V1.Folders.Create(new()
          {
              Name = "Biology 101"
          });

          // 2. Create chapter folders
          var chapter1 = await client.V1.Folders.Create(new()
          {
              Name = "Chapter 1 - Cells",
              ParentFolderID = courseFolder._ID
          });

          var chapter2 = await client.V1.Folders.Create(new()
          {
              Name = "Chapter 2 - Genetics",
              ParentFolderID = courseFolder._ID
          });

          // 3. Upload materials to specific folders
          var fileBytes = await File.ReadAllBytesAsync("cell-structure.pdf");
          var material = await client.V1.Materials.Upload.UploadFile(new()
          {
              File = fileBytes,
              FileName = "cell-structure.pdf",
              Name = "Cell Structure Notes",
              FolderID = chapter1._ID
          });

          // 4. List folder structure
          var subfolders = await client.V1.Folders.List(new()
          {
              ParentFolderID = courseFolder._ID
          });

          Console.WriteLine($"Course folder: {courseFolder.Name}");
          foreach (var folder in subfolders)
          {
              Console.WriteLine($"  └─ {folder.Name}");
          }

          // 5. Get materials in chapter 1
          var chapter1Materials = await client.V1.Materials.List(new()
          {
              FolderID = chapter1._ID
          });

          Console.WriteLine($"\nChapter 1 materials: {chapter1Materials.Materials?.Count ?? 0}");
      }
  }
  ```
</CodeGroup>
