Skip to content

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

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

bash
ssh-keygen -t ed25519 -C "your-description" -f ~/.ssh/amili_sftp

This 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:

SettingValue
Hostsftp.amili.se
Port22
UsernameYour creditor number (e.g. 2001234)
AuthSSH private key (~/.ssh/amili_sftp)

You can verify your connection using the sftp command:

bash
sftp -i ~/.ssh/amili_sftp <username>@sftp.amili.se

File 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

bash
sftp -i ~/.ssh/amili_sftp <username>@sftp.amili.se <<'EOF'
cd input
put /local/path/invoices-2026-04-10.xml
EOF

File 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:

  1. List all files in pickup/
  2. For each file: download it, verify the download succeeded, then delete it from the server
  3. Never delete a file before confirming the download was successful

This ensures no files are lost if a transfer is interrupted mid-run.

Example

bash
# 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