# File System & Code Editor REST APIs

> Inspect directories, read/write index.php, upload binary assets via base64 or multipart form, create folders, and lint PHP code.

**Category:** REST API Reference  
**URL:** https://docs.botlify.cloud/api-files  
**Platform:** Botlify Cloud (https://botlify.cloud)  

---

## File System Actions in api/v1

   

Each bot hosted on Botlify Cloud operates within an isolated dedicated directory. You have complete programmatic control over file creation, editing, uploading, and syntax validation:

   
    
| Action | Parameters | Description |
| --- | --- | --- |
| list_files | bot_id, path (optional) | Returns array of files and folders with size, type, and modified time. |
| read_file | bot_id, file (default: index.php) | Reads file contents. Protected files (.env) have secrets masked. |
| write_file / save_code | bot_id, file, content | Overwrites file contents inside the bot sandbox. |
| create_file | bot_id, path, name, content | Creates a new file in specified folder. |
| upload_file | bot_id, path, name, content, is_base64 (bool) | Uploads binary or text files. Supports base64 encoding or standard multipart form uploads ($_FILES['file']). |
| create_folder | bot_id, path, name | Creates a new subfolder in the bot's workspace. |
| delete_file | bot_id, file | Deletes specified file. Protected system files cannot be deleted. |
| rename_file | bot_id, old_path, new_name | Renames or moves a file within the bot directory. |
| validate_code / lint | code | Runs high-speed token parser and PHP linter on code string without saving. |

   

   
```php

```
