API – Document Upload


This article explains how to upload documents through the API, but you can also upload common and customer-specific documents within the LoanPro UI.

Uploading a document through the API is a two-step process:

  1. Send a POST to receive a pre-signed S3 upload URL
  2. Upload the document to S3 using the pre-signed URL

At this point, you can make changes to the document properties

When you pull document information through the API, you'll notice the active property for all documents will be 1—even for documents that have been inactivated. If a document is inactivated, its active status will remain the same, and its archived status will change to a value of 1.

Uploading a Document

Get a Pre-Signed URL

You can try this request yourself on our ReadMe page—an interactive API documentation page which lists each of our requests. To try uploading a customer document on our ReadMe page, click the button below:

To get a pre-signed URL, send a POST request to either of the following URLs, depending on whether you are uploading a loan document or a customer document:

POST https://loanpro.simnang.com/api/public/api/1/Loans({ID})/document/upload 


POST https://loanpro.simnang.com/api/public/api/1/Customers({ID})/document/upload

Your JSON payload will look something like this:

"sectionId": 1,
"fileName": "test.jpg",
"size": 160000,
"customFileName": "other_name.jpg"

Here's an explanation of each field:

  • sectionId (required) - The ID of the document section. This must be an ID that exists within your LoanPro account.
  • fileName (required) - Name of the file that will be uploaded. This must match the actual file name.
  • customFileName (optional) - Custom file name. This doesn't need to match the actual file name, and will be a label used in LoanPro.
  • size (optional) - Size of the file in bytes.

A 200 response will look like this:

"d": {
"id": "89",
"fileName": "test_1572647511.jpg",
"uploadUrl": "https://autopal-fandora.s3.amazonaws.com/tenants/1/fileAttachments/LoanDocuments/89/test_1572647511.jpg?
"customFileName": "test.jpg",
"mime": "image/jpeg"

The response includes the following:

  • id - The ID of the created Document.
  • fileName - System-generated unique filename (usually the file name with a number appended).
  • customFileName - Name provided in the request payload.
  • mime - Identified MIME type based on the file extension.
  • uploadUrl - S3 URL where the file must be uploaded. This link has an expiration time of 10 minutes.

Upload the File

Now that you've sent that POST request, you've primed the system to receive your actual file. Instead of the endpoint we used on the first request, we send a PUT request with the file to the S3 URL you received in the last response. You'll also remove the normal authorization and Autopal-Instance-Id from your header.

Here is a cURL example:

curl --upload-file "/home/user/Documents/send/test.jpg" 

Updating Documents

To update a document, send a PUT request to the URL of the document. For Loan documents, it is:


and for customer documents it is:


In both cases, replace “<id>” with the ID of the document.

Changing Active Status

To inactivate a document, the "archived" property should be changed from a 0 to a 1. To do this, send a PUT request with a body that looks something like the following:

  "id": 59,
  "archived": 1,
"__update": true,
"__id": 59

Changing Customer Visibility

To change the customer visibility of the document, send a PUT request with the body formatted as follows:

  "id": 59,
  "customerVisible": 1,
"__update": true,
"__id": 59

  • customerVisible – Set to “1” to allow the customer to see the document on the customer website
  • id – The ID of the document being updated

Updating Metadata

To update the metadata of a document, send a PUT request with the body formatted as follows:

  "id": 76,
  "sectionId": "5",
  "description": "this is a description",
  "fileName": "test.png",
"__id": 76,
"__update": true

  • id – The ID of the document to update
  • sectionId – The document’s section ID
  • description – The description for the document
  • fileName – The file name for the document
The sectionId must be a valid one. See Create New Loan Document Section or Create New Customer Document Section for help creating new document sections.

How did we do?

Powered by HelpDocs (opens in a new tab)