Importing Documents with Emails or Text Messages using CSV Files

Modified on Mon, 15 Apr 2024 at 03:45 PM


The TWP Integration supports importing of Documents (PDF files only) which can be displayed to the user on their portal. Data files are added to the system over a Secure FTP connection. SFTP sites and credentials will be provided to you during the onboarding process. Our team is available to assist you with testing your files during onboarding.

General Information

Files can be uploaded to the system at anytime over SFTP. They will be detected and loaded into the portal. The process will take a variable amount of time depending on the number of documents that you upload. Alerts can be configured to notify a system admin when the following events occur:

  • A file is found, and processing is starting
  • An error occurs during processing of a file
  • A file has completed processing and all documents are now loaded

Zip File Format

All files placed on the SFTP site must be a zip file. Every file must have a unique name. You are responsible for not uploading a file with the same name more than once. We recommend using a date or time stamp to avoid this from happening. Once files are processed, they are removed from the FTP site. Nonetheless, names should not be reused. Some examples of good names are:


Each zip file must have the following contents:

  1. A single CSV file titled header.csv
  2. One or more PDF files with unique names
  3. The number of PDFs must match the number of records in the CSV file.

Header.csv File Format

The header.csv file must exist in every zip file. It is the index file for the rest of the documents within the file.

Basic Format

  • The CSV file must be an ASCII text file. Unicode characters are not supported.
  • Each line of the CSV file must end with a carriage return line feed combination (ASCI 13, and 10).
  • The first row in the file must be a header row consisting of the fields you are including.
  • Carriage returns and line feeds cannot exist in any data fields.
  • A carriage return/line feed is not required on the last row of data (but is allowed)
  • Any blank line in the file (after the header) is ignored
  • The following fields are required in every file.
    1. FileName
    2. InternalID
    3. AccountNumber
    4. DocumentDate
    5. DocumentDescription
    6. InternalDocumentDescription
  • Optional Fields:
    1. DocumentProviderKey
    2. EmailTemplateName
    3. EmailAddress
    4. AttachFileToEmail
    5. AttachmentName
  • Optional Texting Fields
    • TextTemplateName
    • TextNumber

Custom Fields

In addition to the supported fields, you may have any number of custom fields. Custom fields are used when you are including an Email Template. They are used to build the email. Custom fields will be isolated to the email being sent. They do not update the account data and will not be displayed on the portal. If no Email Template is specified or the template does not use all of the custom fields, the additional fields are ignored. All custom fields are treated as text and will show up exactly how you supply them. Custom fields must be prefixed with an asterisk (*). This lets the import know that it is not a standard field. Custom fields should not reuse any existing field names. They should contain only letters and numbers. Examples are show below:

  • *LoanType
  • *LegalDisclosure
  • *Address2
  • *Balance

Field Values

The values for each field are described below:




Contains the file name of the Document (PDF) in the zip file that this record represents.


This field should be used to map this document back to your own system. Use a unique identifier that has meaning to you. This field is ignored by us but can be used for auditing purposes.


The account number that this document is associated with.


The date of the Document formatted as YYYY-MM-DD


A description of the document that will be displayed to the customer. Limited to 100 characters. Some examples include “Monthly Statement”. “Account Notification”, “Settlement Offer”


A description of the document that is for internal use only. This will appear internally, but not shown to the customer. This is frequently used to represent internal document codes or notes about the document. Examples include: “STMT”, “DOC-CODE-123”, “Sent by John Doe”


This field is only used by document provider partners that support API's and can be skipped by everyone else. A document provider will be given one or more unique keys to use here. This key is used only when the document is not attached. The key links to the information required to obtain the PDF on demand which must be setup prior to uploading.


This field is optional. When specified, it must be a valid Email Template Name within the system. Specifying a value in this field will cause an email to be generated at the time the document is loaded.

EmailAddress (optional)

When EmailTemplateName is specified, this email address will be used to send the email.


When EmailTemplateName is specified, this field indicates if the PDF will be attached to the email when it sends. The only valid values are "true" and "false"

When EmailTemplateName is specified and AttachFileToEmail is true, this is the name given to the attachment. This should always end in ".pdf". If this is not specified, the default "Document.pdf" is used as the filename.
Custom Fields (described above) can go here. These are optional.
TextTemplateName (optional)

This field is optional. When specified, it must be a valid Text Template Name within the system. Specifying a value in this field will cause a text to be generated at the time the document is loaded.

The cell phone number that the text campaign will be sent to from the account. 

If a document is included and a TextNumber is added the document will be sent as an attachment, There is currently no way to suppress the document. 


Example File

Below is an example of a single file. Because of word wrap, some records appear to extend onto multiple lines. That would not be the case when saving in a CSV file.

62D5E6965B6D.pdf,8595281,12345,2020-06-30,Monthly Statement,MS
D15549A190BE.pdf,8595282,67890,2020-06-30,Payment Confirmation,PK

Standard Import Option

Alternative to sending a file through SFTP you can upload the zip file directly into the web portal. This should only be done for smaller file, since browsers do not generally handle very large file uploads. 

Common Questions

When should I upload the file?

Files can be uploaded at anytime and will be processed shortly after they are uploaded.

How do I upload the file?

Your agency will have access to an SFTP site. You may use any tool that supports SFTP to upload your file or you may automate a process that uploads the file on a regular basis.

How long does it take to import my data?

Our systems run 24/7 and looks for any new data files. Most data files are processed within 1 hour of uploading. Larger files can take more time. Your system will still be accessible while the data files are being imported.

Can we import other types of files?

If you are unable to produce the standard data import files, our team can work with you to create a custom import that will read the format you are able to produce and import it. This will have an additional cost.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article