FileSystem
GET /file-system
Get file system structure
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| clientId | string | query | Client ID for the Foundry world | |
| path | string | query | The path to retrieve (relative to source) | |
| source | string | query | The source directory to use (data, systems, modules, etc.) | |
| recursive | boolean | query | Whether to recursively list all subdirectories | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - File system structure with files and directories
Try It Out
GET /download
Download a file from Foundry's file system
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| clientId | string | query | Client ID for the Foundry world | |
| path | string | query | The full path to the file to download | |
| source | string | query | The source directory to use (data, systems, modules, etc.) | |
| format | string | query | The format to return the file in (binary, base64) | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - File contents in the requested format
Try It Out
POST /upload
Upload a file to Foundry's file system (handles both base64 and binary data)
Parameters
| Name | Type | Required | Source | Description |
|---|---|---|---|---|
| clientId | string | query | Client ID for the Foundry world | |
| path | string | query, body | The directory path to upload to | |
| filename | string | query, body | The filename to save as | |
| source | string | query, body | The source directory to use (data, systems, modules, etc.) | |
| mimeType | string | query, body | The MIME type of the file | |
| overwrite | boolean | query, body | Whether to overwrite an existing file | |
| fileData | string | body | Base64 encoded file data (if sending as JSON) 250MB limit | |
| userId | string | query, body | Foundry user ID or username to scope permissions (omit for GM-level access) |
Returns
object - Result of the file upload operation