SFTP to API

To connect an SFTP client to a REST API, point it at FTPasHTTPS over SSH key auth and configure your HTTP endpoint on the server. Every upload streams into an HTTPS POST to your API — no file ever lands on disk — and every download is fetched from your API and streamed back over SFTP. Your API's HTTP status becomes the client's transfer result: 200 is success, 5xx is a retryable failure.

Banks, payroll providers, and enterprise partners frequently mandate SFTP. Your platform, meanwhile, is a REST API. Rather than standing up an SSH server, writing an ingestion daemon, and securing both, FTPasHTTPS terminates the SFTP session and translates it directly into HTTP requests against your API — in both directions. This guide covers SSH key setup, the request your API receives, the download path, and inline transformations.

How SFTP-to-API works

FTPasHTTPS speaks SFTP (RFC-compliant SSH key auth) on the front and HTTP on the back. There is no disk in between — an upload is a stream, and a download is a stream.

  1. Register your partner's SSH public key against an SFTP user on your FTPasHTTPS server.
  2. The client connects and runs put (SFTP write). FTPasHTTPS opens an HTTPS POST to your REST endpoint.
  3. File bytes stream straight into the request body. Optional inline transforms (CSV→JSON, schema validation, PGP) run mid-stream.
  4. For downloads, the client runs get (SFTP read); FTPasHTTPS calls your API and streams the response bytes back over SFTP.
  5. Your API's HTTP status maps to the SFTP transfer result — 200 completes the transfer, 5xx aborts it so the client retries.

Config & example API request

Define an SFTP server with key-based auth and a REST target. Transformations are declared inline:

server.config
# FTPasHTTPS — SFTP front, REST API back
protocol:        SFTP                # SSH key auth (Professional+)
endpoint:
  url:           https://api.example.com/v1/files
  method:        POST
  headers:
    Authorization: Bearer ${API_TOKEN}
  sign_with:     hmac-sha256
transform:
  - csv_to_json                       # parse CSV body into JSON
  - validate_schema: orders.schema.json
users:
  - username:    payroll-bank
    ssh_keys:
      - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...

When payroll-bank uploads payments.csv, FTPasHTTPS parses it, validates it against your schema, and POSTs JSON to your API:

POST https://api.example.com/v1/files
Content-Type: application/json
Authorization: Bearer ${API_TOKEN}
X-FTPasHTTPS-Signature: sha256=4d7a3e9b6c0f...
X-FTPasHTTPS-Event: file.uploaded

{
  "event": "file.uploaded",
  "protocol": "SFTP",
  "user": "payroll-bank",
  "source_file": "payments.csv",
  "transformed": "csv_to_json",
  "records": [
    { "iban": "NL91ABNA0417164300", "amount": 1840.50, "ref": "INV-0091" },
    { "iban": "DE89370400440532013000", "amount": 920.00, "ref": "INV-0092" }
  ],
  "received_at": "2026-06-20T09:02:11Z"
}

Respond 200 OK to acknowledge. For a download, your API simply returns the file bytes for the requested path and FTPasHTTPS streams them back to the SFTP client.

FTPasHTTPS vs the DIY way

The usual build is a self-hosted SFTP server with a cron job polling its inbox and a script that calls your API. Compared side by side:

 DIY: SFTP box + cron + scriptFTPasHTTPS
API deliveryScript you write and maintainNative — upload is an HTTP POST
Downloads from APIPre-stage files on the SFTP boxRETR streams live from your API
TransformsExtra script, extra depsInline CSV/JSON/XML, schema, PGP
SSH key managementManage authorized_keys by handKeys managed per user in the dashboard
At-rest filesInbox sits on diskStreamed — nothing at rest
Retries & DLQBuild it yourselfBackoff + dead-letter queue built in

When to use SFTP-to-API

Want the raw bytes delivered as a webhook rather than a structured API call? See the FTP to Webhook guide. Comparing managed options? Read the AWS Transfer Family alternative breakdown.

Security model and which plan you need

SFTP authentication uses SSH keys, which you register per user, so there are no shared passwords to leak. Outbound calls to your API are signed with HMAC-SHA256, letting you reject any request that did not originate from FTPasHTTPS. Because nothing is written to disk, there is no ingestion inbox to harden or sweep, and every transfer — success or failure — is recorded in a full audit log you can hand to a security reviewer.

SFTP, custom domains, inline transformations, and schema validation begin on the Professional plan (€49/server/month: 10,000 transfers, 50GB, 25 users). If you also need PGP encryption, SSO/SAML, or a dedicated IP for an allow-listed partner, the Enterprise plan (€99) adds those with unlimited users. The Free and Starter tiers are FTP/FTPS only, so SFTP-to-API specifically starts at Professional — but you can still prototype the API contract on a lower tier using FTPS before your partner cuts over to SFTP.

Connect SFTP to your API

Register a public key, point it at your endpoint, and let uploads flow straight into your REST API. Start on the free tier.

Start free — no credit card

Frequently asked questions

How do I connect an SFTP client to a REST API?

Point the SFTP client at FTPasHTTPS using SSH key authentication and configure your REST endpoint on the server. Uploads are streamed into an HTTPS POST to your API, and downloads are fetched from your API and streamed back over SFTP.

Does FTPasHTTPS support SSH key authentication for SFTP?

Yes. SFTP uses SSH key authentication and runs on the Professional plan and above. You register your client public keys against each user.

Can I transform files between CSV, JSON, and XML on the way to my API?

Yes. On the Professional plan and above, FTPasHTTPS can run inline transformations such as CSV to JSON, JSON to XML, schema validation, compression, and PGP encryption before the file reaches your API.

How do SFTP downloads work against a REST API?

When a client issues a download (RETR), FTPasHTTPS calls your API to fetch the file bytes and streams them back over the SFTP connection. Your API decides what bytes to return for a given path.

How are HTTP responses mapped back to SFTP status codes?

An HTTP 200 from your API maps to a successful transfer (FTP 226 Transfer complete), and an HTTP 5xx maps to a failed transfer (FTP 451 Action aborted) so the client knows to retry.