Thanks to visit codestin.com
Credit goes to docs.sim.ai

SFTP

Usage Instructions

Upload, download, list, and manage files on remote servers via SFTP. Supports both password and private key authentication for secure file transfers.

Actions

sftp_upload

Upload files to a remote SFTP server

Input

ParameterTypeRequiredDescription
hoststringYesSFTP server hostname or IP address
portnumberYesSFTP server port (default: 22)
usernamestringYesSFTP username
passwordstringNoPassword for authentication (if not using private key)
privateKeystringNoPrivate key for authentication (OpenSSH format)
passphrasestringNoPassphrase for encrypted private key
remotePathstringYesDestination directory on the remote server
filesfile[]NoFiles to upload
fileContentstringNoDirect file content to upload (for text files)
fileNamestringNoFile name when using direct content
overwritebooleanNoWhether to overwrite existing files (default: true)
permissionsstringNoFile permissions (e.g., 0644)

Output

ParameterTypeDescription
successbooleanWhether the upload was successful
uploadedFilesjsonArray of uploaded file details (name, remotePath, size)
messagestringOperation status message

sftp_download

Download a file from a remote SFTP server

Input

ParameterTypeRequiredDescription
hoststringYesSFTP server hostname or IP address
portnumberYesSFTP server port (default: 22)
usernamestringYesSFTP username
passwordstringNoPassword for authentication (if not using private key)
privateKeystringNoPrivate key for authentication (OpenSSH format)
passphrasestringNoPassphrase for encrypted private key
remotePathstringYesPath to the file on the remote server
encodingstringNoOutput encoding: utf-8 for text, base64 for binary (default: utf-8)

Output

ParameterTypeDescription
successbooleanWhether the download was successful
filefileDownloaded file stored in execution files
fileNamestringName of the downloaded file
contentstringFile content (text or base64 encoded)
sizenumberFile size in bytes
encodingstringContent encoding (utf-8 or base64)
messagestringOperation status message

sftp_list

List files and directories on a remote SFTP server

Input

ParameterTypeRequiredDescription
hoststringYesSFTP server hostname or IP address
portnumberYesSFTP server port (default: 22)
usernamestringYesSFTP username
passwordstringNoPassword for authentication (if not using private key)
privateKeystringNoPrivate key for authentication (OpenSSH format)
passphrasestringNoPassphrase for encrypted private key
remotePathstringYesDirectory path on the remote server
detailedbooleanNoInclude detailed file information (size, permissions, modified date)

Output

ParameterTypeDescription
successbooleanWhether the operation was successful
pathstringDirectory path that was listed
entriesjsonArray of directory entries with name, type, size, permissions, modifiedAt
countnumberNumber of entries in the directory
messagestringOperation status message

sftp_delete

Delete a file or directory on a remote SFTP server

Input

ParameterTypeRequiredDescription
hoststringYesSFTP server hostname or IP address
portnumberYesSFTP server port (default: 22)
usernamestringYesSFTP username
passwordstringNoPassword for authentication (if not using private key)
privateKeystringNoPrivate key for authentication (OpenSSH format)
passphrasestringNoPassphrase for encrypted private key
remotePathstringYesPath to the file or directory to delete
recursivebooleanNoDelete directories recursively

Output

ParameterTypeDescription
successbooleanWhether the deletion was successful
deletedPathstringPath that was deleted
messagestringOperation status message

sftp_mkdir

Create a directory on a remote SFTP server

Input

ParameterTypeRequiredDescription
hoststringYesSFTP server hostname or IP address
portnumberYesSFTP server port (default: 22)
usernamestringYesSFTP username
passwordstringNoPassword for authentication (if not using private key)
privateKeystringNoPrivate key for authentication (OpenSSH format)
passphrasestringNoPassphrase for encrypted private key
remotePathstringYesPath for the new directory
recursivebooleanNoCreate parent directories if they do not exist

Output

ParameterTypeDescription
successbooleanWhether the directory was created successfully
createdPathstringPath of the created directory
messagestringOperation status message

On this page