API
Filestash has an API to enable developers to interact with any type of storage in one consistent manner whether it's S3, SFTP, FTP or anything else. To start using that API, you first need to create an API key from the admin console:

For the sake of this documentation page, we've setup that api key 'foobar' which has some cors rules setup to work from any filestash subdomain making this page entirely interactive. Also we've created a shared link called 'shareID' which we will be using in this page. The list of curl commands will only be working if you set this up first in your terminal:
export INSTANCE=https://demo.filestash.app export SHARE=shareID export KEY=foobar
API for File management
There's an API endpoint for every possible file management operation you can think of:
- list files
- upload a file
- download a file
- zip something
- rename something
- delete something
- create a directory
- create an empty file
curl "$INSTANCE/api/files/ls?share=$SHARE&key=$KEY&path=/"
{ "status": "ok", "results": [ { "name": "README.org", "type": "file", "size": 281, "time": 1591432761000 }, { "name": "Documents", "type": "directory", "size": 0, "time": 1591432774000 } ] }
curl "$INSTANCE/api/files/cat?share=$SHARE&key=$KEY&path=/input.txt" \ -X POST --data @input.txt
curl -X GET "$INSTANCE/api/files/cat?key=$KEY&share=$SHARE&path=/input.txt"
curl "$INSTANCE/api/files/zip?share=$SHARE&key=$KEY&path=/input.txt"
curl -X POST "$INSTANCE/api/files/mkdir?key=$KEY&share=$SHARE&path=/tmp/"
curl -X POST "$INSTANCE/api/files/touch?key=$KEY&share=$SHARE&path=/test.txt"
curl -X POST "$INSTANCE/api/files/mv?key=$KEY&share=$SHARE&from=/input.txt&to=/test/input.txt"
curl -X POST "$INSTANCE/api/files/rm?key=$KEY&share=$SHARE&path=/test/"
If you want to create shared links programmatically, check this out
Want to contribute to this page? Edit this page!