I self-host a lot of the tools and services I use on a daily basis, meaning that rather than relying on iCloud or Dropbox or GitHub, I run a comparable (usually open-source) service on a server I control, either in the cloud or out of a server in my house. One thing that has been missing from that setup has been a tool to manage documents (receipts, tax forms, bank statements, etc). I recently stumbled onto Docspell and have been trying it out in that role for the last few days. The only problem is that it didn’t have an iOS app to use to upload receipts and documents to it. Rather than try to make an app myself, I saw that there was a simple HTTP POST API for uploading documents, which was compatible with the iOS Shortcuts app.

So I built a shortcut to do that. When you add it to your Shortcuts app on an iPhone or iPad, it’ll ask you a few questions, like what your upload API URL is and what kind of document it’ll prompt you for (e.g. if you wanted a shortcut specific to receipts). It’ll default to having the name “save to Docspell”, but you can change that to something else like “save a receipt”.

There are four main ways to use this:

  1. You can tap it as a button from the Shortcuts app or widgets. It’ll ask you the name of the thing you want, and then prompt you to either select a file or capture some photos with the camera.
  2. You can ask Siri to “save to Docspell” (or whatever you named it), and it’ll prompt you for those same things.
  3. You can use the share button to save stuff from across your device. Attachments in mail, downloaded PDFs, screenshots, or really anything that could be treated as a file. In theory you can even share webpages to it and it should make an archive of the page (though my server times out when I try this).
  4. You can use it as an export target for other workflows, meaning if you wanted to use a Shortcut to generate a PDF, you could then feed it into the Save to Docspell shortcut and upload it there.

When you run it without input (#1 and #2 above) it’ll ask whether you want to upload a file or take some photos with the camera. If you take multiple photos, it’ll stitch them into a PDF for upload. All photos will be converted to JPEG, even if your phone is set to save as HEIC by default, and the orientation will be fixed to make sure OCR works. If you select a file, you can use the phone’s file browser to pick one from your device, iCloud, or any storage providers (e.g. Nextcloud) that you might want to export from. And it’ll notify you when the upload is successful, using a message directly from the API, so it can’t fail silently unless there’s a problem on the server. You can also setup multiple copies of the workflow with different public API upload URLs and names, so if you wanted one for receipts and a different one bank statements.