How can we help?

How to upload expense files using the API?

Noga Tubi
Noga Tubi
  • Updated
Upload expense files using Torii's APIs

Who is this article for?

You are a developer, with knowledge of REST API usage, tasked with uploading an expense report file to Torii.


Uploading an expense file to Torii using the API consists of 2 steps:

  1. Uploading the file (requires 3 API requests)

  2. Parsing the file to extract expenses (requires a single API request)


To use Torii's APIs, you must have a valid API key.

Learn how to use the API here.







Torii's API key



The full name of your file



The content-type of your file

For example: text/csv


Torii's file type

For expenses, type is: expenseReport


Internally used

This parameter is returned from


The pre-signed URL

This parameter is returned from


Unique file identifier

This parameter is returned from


Unique parsing identifier

This parameter is returned from|manual)



STEP 1: Uploading an expense file

In order to upload an expense file to Torii using our APIs, follow these 3 steps:

  • A) Get the required parameters for uploading your file:

curl -H "Authorization: Bearer API_KEY" "{FILE_NAME}&type={CONTENT_TYPE}"


Example response:

"uploadFileParameters": {
"url": "S3_URL",
"filePath": "1612686123657/test_file.xlsx"
  • B) Use the S3_URL provided in the previous step to upload your file:

curl -H "Content-Type: {CONTENT_TYPE}" --data-binary '@PATH/TO/YOUR/FILE' -X PUT "{S3_URL}"
  • C) Inform Torii that the file has been successfully uploaded:

curl -d '{"path":"{FILE_PATH}","type":"expenseReport"}' -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" ""



STEP 2: Parsing an expense file

Use the following code snippet to parse an expense file with automatic column matching:

curl -X PUT -d '{"idFile":"{FILE_ID}"}' -H "Authorization: Bearer API_KEY"



  • Parsing a file may take some time, so after sending a parse request, make sure to poll{PARSING_ID} to verify that the request was successful

  • If automatic parsing did not succeed, use "manual column matching" via this endpoint: (Check the Parse manually API in our docs for more information)

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request