Folders
Create, rename and delete folders to organize your site's file tree. Folders are created automatically when you upload a file into a nested path — these endpoints are for when you want to manage the structure explicitly.
All endpoints require a valid X-API-Key header.
POST /api/v1/files/create-folder
Create an empty folder.
Body parameters
| Field | Type | Description |
|---|---|---|
path | string (required) | Folder path. Parent folders are created as needed. |
curl -X POST https://www.flexweg.com/api/v1/files/create-folder \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path": "images"}'
curl -X POST https://www.flexweg.com/api/v1/files/create-folder \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path": "blog/2026"}'
Most of the time you don't need it — uploading a file to assets/css/main.css creates assets/ and assets/css/ automatically. Use this endpoint when you want to create a folder structure up-front (scaffolding), or an empty folder that doesn't yet have files.
POST /api/v1/files/rename-folder
Rename or move a folder and all its contents to a new path.
Body parameters
| Field | Type | Description |
|---|---|---|
old_path | string (required) | Current folder path. |
new_path | string (required) | Target folder path. |
curl -X POST https://www.flexweg.com/api/v1/files/rename-folder \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"old_path": "images", "new_path": "photos"}'
curl -X POST https://www.flexweg.com/api/v1/files/rename-folder \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"old_path": "blog/2023", "new_path": "blog/2024"}'
Every file under the folder gets a new public URL. External links, bookmarks and references inside your HTML (if they use absolute paths to the old location) will break until you update them.
DELETE /api/v1/files/delete-folder
Delete a folder and every file it contains permanently.
Query parameters
| Field | Type | Description |
|---|---|---|
path | string (required) | Folder path to delete. |
curl -X DELETE "https://www.flexweg.com/api/v1/files/delete-folder?path=old-images" \
-H "X-API-Key: YOUR_API_KEY"
This endpoint walks the folder tree and deletes everything below the target path. There is no trash bin; once gone, it's gone.