Skip to main content
The Lender API uses a staged file upload pattern to securely handle document uploads. Rather than sending file data directly through the GraphQL API, you first create a staged upload to get a signed URL, upload the file to that URL, and then reference the staged file when creating an engagement.

The 3-step upload flow

Staged File Upload Flow
1

Create a staged file upload

Call the stagedFileUploadCreate mutation with the filename and MIME type of the document you want to upload:
Request
Variables:
Variables
Response:
Response
The signedUploadUrl expires at the date/time indicated by signedUploadUrlExpiryDate. Make sure you upload the file before this time, or you’ll need to create a new staged upload.
2

Upload the file to the signed URL

Use an HTTP PUT request to upload the file binary to the signedUploadUrl returned in step 1. Set the Content-Type header to match the file’s MIME type:
This is a direct upload to the storage service — it does not go through the GraphQL API and does not require your API authentication headers.
3

Pass the file to an engagement

Once the file is uploaded, use the FileRecordGID (the id from step 1) in the newMortgageFileIds array when creating an engagement:
Request
Variables

Uploading multiple files

You can upload multiple files by repeating steps 1 and 2 for each file, then passing all of the FileRecordGID values in the newMortgageFileIds array:

Supported MIME types

The FileMimeType enum defines the file types you can upload:

Error handling

Staged upload errors

The stagedFileUploadCreate mutation can return: When passing file IDs to engagementCreate, you may encounter:
The FILE_RECORD_NOT_STAGED error means you created the staged upload (step
  1. but haven’t completed the actual file upload (step 2) before trying to use the file in step 3. Make sure the HTTP PUT to the signed URL completes successfully before referencing the file.

Next steps

API Reference

Explore all queries, mutations, and types available in the Lender API.

Changelog

Stay up to date with changes to the Lender API.