Exports to FTP/SFTP
Some exports can upload their result files to an FTP or SFTP server:
- customer export
- customer actions export
- product export
- promotions export
- customer segmentation changes export
- product segmentation changes export
You can still use these exports without an external destination and download the result files via URL instead. See Exports overview for that flow.
There are two ways to export data to FTP/SFTP:
- Create an external integration in your Maestra project.
- Pass the server connection details in the export request body.
Files are uploaded to the destination as soon as each one is ready. During a long export, files are created and written to storage one by one throughout the job, not only after the job finishes.
Recurring export from the UI in Maestra.
Create recurring export jobs in Integrations -> Integration setup -> FTP/SFTP data import and export. The interval between runs is counted from the moment the previous run finishes, so the daily start time shifts based on how long the previous run took.
When you save the job, Maestra runs a test connection to verify the credentials.
For FTP, you can authenticate with a username and password.
For SFTP, you can authenticate with:
- username and password
- username and SSH key
The OpenSSH key must be generated without a passphrase (empty passphrase) using RSA encryption. Add the private key in the job settings; the public key must already be on the server.
Many SFTP servers don't support the ssh-rsa algorithm by default, since it's considered legacy. If yours doesn't, either enable ssh-rsa on the server or generate a new key using the modern, recommended ed25519 algorithm.
Passing connection details in the request
The submit-and-poll flow doesn't change. See Exports overview for the base contract.
To send results to external storage, include the connection details in the first submit request. Files are always written to the specified directory, gzipped, and get the .gz extension. The uncompressed file format depends on the operation's export settings.
Once results are saved to external storage, the status response only reports job status — it doesn't return file URLs.
FTP/SFTP export with username and password
Add this to the request:
{
"exportOutput": {
"type": "<FTP/SFTP>",
"credentials": {
"userName": "<Username>",
"password": "<Password>"
},
"server": {
"url": "<FTP server URL, e.g. ftp://127.0.0.1/>",
"port": "<Port>"
},
"directory": "<Destination folder>"
}
}SFTP export with SSH key
Add this to the request:
{
"exportOutput": {
"type": "SFTP",
"credentials": {
"userName": "<Username>",
"sshPrivateKey": "<Base64-encoded SSH private key>"
},
"server": {
"url": "<SFTP server URL>",
"port": "<Port>"
},
"directory": "<Destination folder>"
}
}Updated about 2 months ago

