Standard SFTP File Drop-off and Pickup
This guide describes the standard workflow for delivering data files to Amili and picking up report files using SFTP.
All SFTP accounts use SSH key pair authentication by default. Your SFTP credentials (host, port, and username) are provided by Amili when your account is configured.
Table of Contents
- Authentication — Generate a key pair and register your public key
- Connecting to the SFTP server — Test your connection
- File Drop-off — Upload input files for processing
- File Pickup — Download and acknowledge report files
Authentication
SFTP authentication uses an SSH key pair. You generate the key pair and provide your public key to Amili, who registers it on your account. Your private key stays on your system and is never shared.
Generating a Key Pair
ssh-keygen -t ed25519 -C "your-description" -f ~/.ssh/amili_sftpThis creates two files:
~/.ssh/amili_sftp— your private key (keep this secret, never share it)~/.ssh/amili_sftp.pub— your public key (provide this to Amili)
Registering your Public Key
Send the contents of ~/.ssh/amili_sftp.pub to Amili. Amili will register it on your account, after which you can connect using your private key.
Connecting to the SFTP Server
Your SFTP connection details are:
| Setting | Value |
|---|---|
| Host | sftp.amili.se |
| Port | 22 |
| Username | Your creditor number (e.g. 2001234) |
| Auth | SSH private key (~/.ssh/amili_sftp) |
You can verify your connection using the sftp command:
sftp -i ~/.ssh/amili_sftp <username>@sftp.amili.seFile Drop-off
Upload your input files to the input/ folder on the SFTP server. Amili's import system monitors this folder and processes files automatically once an upload completes.
Example
sftp -i ~/.ssh/amili_sftp <username>@sftp.amili.se <<'EOF'
cd input
put /local/path/invoices-2026-04-10.xml
EOFFile Pickup
Amili places report and output files in the pickup/ folder. You have read and delete access to this folder.
Recommended implementation pattern
In an automated integration, implement pickup as follows:
- List all files in
pickup/ - For each file: download it, verify the download succeeded, then delete it from the server
- Never delete a file before confirming the download was successful
This ensures no files are lost if a transfer is interrupted mid-run.
Example
# List available files
sftp -i ~/.ssh/amili_sftp <username>@sftp.amili.se <<'EOF'
ls pickup/
EOF
# Download a specific file and delete it after pickup
sftp -i ~/.ssh/amili_sftp <username>@sftp.amili.se <<'EOF'
get pickup/report-2026-04-10.xml /local/path/report-2026-04-10.xml
rm pickup/report-2026-04-10.xml
EOF