Filestorage Guide
Learn how to use the filestorage slash command for file storage operations
How to use it?
Basic Command Structure
Parameters
Required:
action
- Operation to perform (upload, create, append, get, list, delete, update)filename
- Name of the file (required for most operations)
Optional:
content
- File content for upload/create/append operationsmetadata
- Additional information about the filefile_links_expire_in_days
- Link expiry: 1-7 days or “never” for public filesfile_links_expire_in_minutes
- Minute-level precision for link expiryget_file_contents
- Set to true to retrieve file content along with metadataformat
- Set to “light” for minimal file listingreplaceExisting
- Whether to replace existing files with same filename (defaults to “true”; if “false”, adds timestamp to filename)
File Link Expiration
- Days: 1-7 days or “never” to make file public
- Minutes: Can be used for minute-level precision
- Combined: Use both (e.g., days=“1”, minutes=“30” = 1 day 30 minutes)
- Default: 1 day if not specified
- Maximum: 7 days total
- Public files: Use days=“never” (minutes ignored)
Response Format
File creation/update:
File metadata (full details):
File listing (light format):
Tools
Upload File
Upload a file from buffer or file input
Parameters:
action
(required) - Set to “upload”file
(required) - File or buffer to uploadmetadata
(optional) - File metadatafile_links_expire_in_days
(optional) - Link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precisionreplaceExisting
(optional) - Whether to replace existing files with same filename (defaults to “true”)
Example:
Create or Replace Document
Create a new file or replace existing one with text content
Parameters:
action
(required) - Set to “create”filename
(required) - Name of the filecontent
(required) - File contentmetadata
(optional) - File metadatafile_links_expire_in_days
(optional) - Link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precisionreplaceExisting
(optional) - Whether to replace existing files with same filename (defaults to “true”)
Example:
Append to Document
Append content to an existing file
Parameters:
action
(required) - Set to “append”filename
(required) - Name of the filecontent
(required) - Content to appendmetadata
(optional) - Updated metadatafile_links_expire_in_days
(optional) - Link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precision
Example:
Get Document
Retrieve file metadata or content
Parameters:
action
(required) - Set to “get”filename
(required) - Name of the fileget_file_contents
(optional) - Set to true to retrieve contentfile_links_expire_in_days
(optional) - Link expiry for returned signedUrl
Examples:
Get metadata only:
Get metadata and content:
Get with custom link expiry:
List Files
List all files with full or light details
Parameters:
action
(required) - Set to “list”format
(optional) - Set to “light” for minimal infofile_links_expire_in_days
(optional) - Link expiry for returned signedUrls
Response includes:
- Full details: All metadata, signedUrl, and accessList
- Light format: File ID, filename, filepath, type, mime_type, file_size, isPublic status, collectionId, timestamps, and metadata object
Examples:
List with full details:
List with minimal info:
Delete Document
Delete a file from storage
Parameters:
action
(required) - Set to “delete”filename
(required) - Name of the file
Example:
Update File Link Expiry
Update link expiration settings for existing files
Parameters:
action
(required) - Set to “update”filename
(required) - Name of the filefile_links_expire_in_days
(required) - New link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precisionmetadata
(optional) - Updated metadata
Examples:
Make file public:
Set custom expiry:
What can you do with it?
Store, retrieve, update, and manage files in the cloud storage system. Supports text and binary files with metadata, link expiration control, and public file sharing options. Perfect for configuration management, system logging, document storage, and file sharing with controlled access periods.
File Types and Content Extraction
Supported File Types
Document files: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT Image files: PNG, JPG, JPEG, WEBP Audio files: MP3, WAV Video files: MP4, MOV Data files: CSV, JSON, HTML Archive files: ZIP
Content Extraction
For supported document types (PDF, DOCX, XLSX, PPTX, CSV), the system automatically extracts content when retrieving files. This works for:
- PDF files
- Word documents (DOC, DOCX)
- Excel files (XLS, XLSX)
- PowerPoint files (PPT, PPTX)
- CSV files
File Type Handling
Text files (JSON, TXT, HTML, CSV):
- Use
get_file_contents: true
to retrieve content directly - Can be updated with POST method
Binary files (PNG, JPG, PDF, MP3, etc.):
- Use signedUrl from metadata to access file content
- Use PATCH method to update metadata and link expiry without resending content
Examples
Configuration Management
System Logging
Document Storage
Log File Management
Making Files Public
Notes
- Each file must have a unique filename within your storage
- Files can include optional metadata for organization and tracking
- Default link expiry is 1 day if not specified
- Maximum expiry is 7 days (except for public files)
- Use
file_links_expire_in_days: "never"
to make files public - Access history is automatically tracked for all files
- Content extraction is available for common document formats
- For binary files, use the signedUrl to access content
- Race conditions: There is no race condition prevention in place. If you have multiple automations writing to the same file, you will experience unexpected results
- File overwriting: By default, creating a file with an existing filename will overwrite the existing file completely. Use
replaceExisting: "false"
to add a timestamp to the filename instead - Signed URLs: Files are accessible via signed URLs that expire based on the
file_links_expire_in_days
setting. Access history is maintained in theaccessList
with entries including action performed, provider ID, and timestamp