Post Documents

Post Documents

  1. Get the associationCustomerId using GET /v1/customers.
  2. Use GET /v1/document-folders to get the correct folder to house the document. Alternatively if the folder does not exist, use POST /v1/document-folders to generate a new folder.
  3. Documents can be sent to Sageworks using POST /v1/documents.

Get associated customer data

Use GET /v1/customers to find the correct associationCustomerId. This will be the customerId in the response.

curl -X GET "https://api.sageworks.com/v1/customers?includeUserDefinedFields=false" -H "accept: application/json" -H "authorization: Bearer [token]"
[
  {
    "id": 7456123,
    "name": "Example, LLC",
    "dba": "Example Doing Business As",
    "userDefinedFields": {
      "User Defined Field 1": "Value 1",
      "User Defined Field 2": "Value 2"
    },
    "creditScore": 98,
    "businessType": "llc",
    "dnbScore": "567",
    "addresses": [
      {
        "line1": "123 Main St",
        "line2": "Suite 2078",
        "city": "Example City",
        "state": "NY",
        "postalCode": "00101",
        "country": "US",
        "addressType": "primary"
      }
    ],
    "phoneNumbers": [
      {
        "type": "primary",
        "number": "(999)999-9999"
      }
    ],
    "type": "business",
    "emailAddress": "[email protected]",
    "industryCode": "99999",
    "isDeleted": false,
    "uniqueIdentifier": "785654",
    "taxId": "111111111",
    "restricted": false,
    "checkingBalance": 15000,
    "savingsBalance": 100000,
    "cDsBalance": 50000,
    "averageChecking": 14500,
    "averageSavings": 125000,
    "averageCDs": 60000,
    "numberOfYearsEmployed": 0,
    "msa": 16980,
    "stateCode": 12,
    "countyCode": "123",
    "tractCode": "3453",
    "longitude": -87.656376,
    "latitude": 41.94763,
    "medianHouseholdIncome": 107250,
    "metropolitanDivision": "Chicago-Naperville-Evanston, IL",
    "metropolitanDivisionCode": "1234242",
    "loanOfficerId": 438331,
    "ficoSbssCreditScore": 450,
    "ficoSbssCreditScoreDate": "2019-06-09",
    "entryMethod": "operatingCompany",
    "professionalLLC": true,
    "yearFounded": 1999,
    "businessRegistered": "NY",
    "stateOfFormation": "NY",
    "franchiseName": "Franchise #1",
    "franchiseLegalName": "#1 Franchise",
    "franchiseStartDate": 1999,
    "sbaCode": "123",
    "cityHQ": "Chicago",
    "stateHQ": "IL",
    "franchiseDataImportDate": "2019-09-06",
    "franchiseDataFinancialPeriod": 2019,
    "historicalSuccessRate": 130,
    "systemSupportAndExpenseCommitment": 75,
    "resaleActivityLevel": 25,
    "mngmtExperienceStability": 35,
    "averageUnitRevenueGrowth": 60,
    "prospectScreening": 30,
    "unitEconomics": 70,
    "franchiseAgreementAssessment": 15,
    "franchiseeRelationship": 30,
    "projectedUnitSuccess": 200,
    "recurringRevenueSelfSufficiency": 50,
    "totalFundScore": 750,
    "finStatementStrength": 25,
    "franchisedUnits": 100,
    "minInitial": 258625,
    "maxInitial": 1609500,
    "avgInitial": 602350,
    "companyOwnedUnits": 53,
    "projectedOpenings": 12,
    "compoundAnnualUnitGrowthRate": 91,
    "compoundedUnitSuccessRate": 0.96,
    "experianDBT": 5,
    "ansoniaCreditRating": "3071K-8",
    "ansoniaRiskScore": 95,
    "creditLogicScore": 58,
    "dbViabilityRating": "",
    "lastReportRun": "2019-06-07",
    "bankruptciesCount": 0,
    "collectionsCount": 0,
    "judgmentsCount": 0,
    "chargeOffsCount": 0,
    "liensCount": 0,
    "nsfChecksCount": 0,
    "dataDepthScore": 0
  },
  {
    "id": 4213102,
    "name": "Smith, John",
    "firstName": "John",
    "lastName": "Smith",
    "userDefinedFields": {
      "User Defined Field 1": "Value 1",
      "User Defined Field 2": "Value 2"
    },
    "creditScore": 650,
    "addresses": [
      {
        "line1": "456 Circle St",
        "line2": "Apt 4B",
        "city": "New York",
        "state": "NY",
        "postalCode": "00101",
        "country": "US",
        "addressType": "primary"
      }
    ],
    "phoneNumbers": [
      {
        "type": "mobile",
        "number": "(999)999-9999"
      }
    ],
    "type": "person",
    "emailAddress": "[email protected]",
    "isDeleted": false,
    "uniqueIdentifier": "746313",
    "restricted": false,
    "checkingBalance": 15000,
    "savingsBalance": 100000,
    "cDsBalance": 50000,
    "averageChecking": 14500,
    "averageSavings": 125000,
    "averageCDs": 60000,
    "citizenshipStatus": "usCitizen",
    "maritalStatus": "legallySeparated",
    "isActiveMiltaryDuty": true,
    "isDependentOfActiveMiltaryDuty": false,
    "civDescription": "",
    "numberOfYearsEmployed": 0,
    "idDescription": "Passport",
    "idNumber": "111111",
    "idIssueDate": "2014-01-02",
    "idExpirationDate": "2024-01-02",
    "idIssuingAuthority": "",
    "loanOfficer": "Test Loan Officer",
    "loanOfficerId": 438323,
    "loanAdministrator": "Test Loan Admin",
    "equifaxCreditScore": 670,
    "equifaxCreditScoreDate": "2018-04-05",
    "experianCreditScore": 700,
    "experianCreditScoreDate": "2019-05-06",
    "transunionCreditScore": 750,
    "transunionCreditScoreDate": "2019-06-07",
    "ficoSbssCreditScore": 720,
    "ficoSbssCreditScoreDate": "2019-06-08",
    "bankruptcies": "0",
    "dateOfLastBankruptcy": "",
    "historical30DayDelinquencies": "2",
    "historical60DayDelinquencies": "1",
    "historical90DayDelinquencies": "0",
    "historicalOtherDelinquencies": "0",
    "currentMortgagePastDue": "0",
    "currentInstallmentPastDue": "0",
    "currentAutoPastDue": "90",
    "currentEducationPastDue": "0",
    "currentOpenPastDue": "0",
    "currentRevolvingPastDue": "100",
    "currentOtherPastDue": "0",
    "currentTotalPastDue": "0",
    "entryMethod": "operatingCompany",
    "yearFounded": 0
  },
  {
    "id": 45123997,
    "name": "Example Farm",
    "userDefinedFields": {
      "User Defined Field 1": "Value 1",
      "User Defined Field 2": "Value 2"
    },
    "creditScore": 98,
    "businessType": "soleProp",
    "dnbScore": "567",
    "addresses": [
      {
        "line1": "964 Meadow Ave",
        "line2": "",
        "city": "Seattle",
        "state": "WA",
        "postalCode": "90541",
        "country": "US",
        "addressType": "primary"
      }
    ],
    "phoneNumbers": [
      {
        "type": "primary",
        "number": "(999)999-9999"
      }
    ],
    "type": "farm",
    "emailAddress": "[email protected]",
    "industryCode": "99999",
    "isDeleted": false,
    "restricted": false,
    "checkingBalance": 15000,
    "savingsBalance": 100000,
    "cDsBalance": 50000,
    "averageChecking": 14500,
    "averageSavings": 125000,
    "averageCDs": 60000,
    "numberOfYearsEmployed": 0,
    "msa": 16980,
    "stateCode": 12,
    "countyCode": "123",
    "tractCode": "33433",
    "longitude": -87.656376,
    "latitude": 41.94763,
    "medianHouseholdIncome": 107250,
    "metropolitanDivision": "Chicago-Naperville-Evanston, IL",
    "metropolitanDivisionCode": "1234242",
    "loanOfficerId": 438332,
    "ficoSbssCreditScore": 450,
    "ficoSbssCreditScoreDate": "2019-06-09",
    "entryMethod": "operatingCompany",
    "professionalLLC": false,
    "yearFounded": 0,
    "farmRegistered": "MI",
    "franchiseName": "Franchise #1",
    "franchiseLegalName": "#1 Franchise",
    "franchiseStartDate": 1999,
    "sbaCode": "123",
    "cityHQ": "Chicago",
    "stateHQ": "IL",
    "franchiseDataImportDate": "2019-09-06",
    "franchiseDataFinancialPeriod": 2019,
    "historicalSuccessRate": 130,
    "systemSupportAndExpenseCommitment": 75,
    "resaleActivityLevel": 25,
    "mngmtExperienceStability": 35,
    "averageUnitRevenueGrowth": 60,
    "prospectScreening": 30,
    "unitEconomics": 70,
    "franchiseAgreementAssessment": 15,
    "franchiseeRelationship": 30,
    "projectedUnitSuccess": 200,
    "recurringRevenueSelfSufficiency": 50,
    "totalFundScore": 750,
    "finStatementStrength": 25,
    "franchisedUnits": 100,
    "minInitial": 258625,
    "maxInitial": 1609500,
    "avgInitial": 602350,
    "companyOwnedUnits": 53,
    "projectedOpenings": 12,
    "compoundAnnualUnitGrowthRate": 91,
    "compoundedUnitSuccessRate": 0.96,
    "experianDBT": 5,
    "ansoniaCreditRating": "3071K-8",
    "ansoniaRiskScore": 95,
    "creditLogicScore": 58,
    "dbViabilityRating": "",
    "lastReportRun": "2019-06-07",
    "bankruptciesCount": 0,
    "collectionsCount": 0,
    "judgmentsCount": 0,
    "chargeOffsCount": 0,
    "liensCount": 0,
    "nsfChecksCount": 0,
    "dataDepthScore": 0
  }
]

Get the associated folder

Use GET /v1/document-folders to find all the existing document folders in the account.

curl -X GET "https://api.sageworks.com/v1/document-folders" -H "accept: application/json" -H "authorization: Bearer [token]"
{
  "items": [
    {
      "id": 69526,
      "type": "customer",
      "name": "Loan Documents",
      "parentDocumentFolderId": null,
      "isDeleted": false
    },
    {
      "id": 69527,
      "type": "customer",
      "name": "Financial Documents",
      "parentDocumentFolderId": null,
      "isDeleted": false
    },
    {
      "id": 69528,
      "type": "customer",
      "name": "Collateral Documents",
      "parentDocumentFolderId": null,
      "isDeleted": false
    },
    {
      "id": 69529,
      "type": "customer",
      "name": "Tickler Documents",
      "parentDocumentFolderId": null,
      "isDeleted": false
    },
    {
      "id": 69530,
      "type": "customer",
      "name": "Workflow Documents",
      "parentDocumentFolderId": null,
      "isDeleted": false
    },
    {
      "id": 72323,
      "type": "customer",
      "name": "Flood Reports",
      "parentDocumentFolderId": 69528,
      "isDeleted": false
    },
    {
      "id": 79163,
      "type": "customer",
      "name": "Esignature Template Audit Trails",
      "parentDocumentFolderId": null,
      "isDeleted": false
    },
    {
      "id": 83133,
      "type": "customer",
      "name": "OCR Tax Documents",
      "parentDocumentFolderId": 69527,
      "isDeleted": false
    }
  ]
}

Create a new folder if one doesn't exist

Use POST /v1/document-folders to create a new folder to post documents.

{
  "name": "My Financial Document Folder",
  "type": "customer",
  "isDeleted": false,
  "parentDocumentFolderId": 123
}
{
  "id": 86475,
  "type": "customer",
  "name": "My Financial Document Folder",
  "parentDocumentFolderId": 69527,
  "isDeleted": false
}

Post the document

Use POST /v1/documents to post the document into Sageworks. Note: documentContent must be in base64 format.

{
  "associationCustomerId": 85477283,
  "document": {
    "description": "Test File",
    "documentDated": "2017-12-31",
    "documentFolderId": 69526,
    "uniqueIdentifier": "Test Document 123",
    "name": "Test File",
    "fileName": "TestFileName.txt"
  },
  "documentContent": {
    "content": "Z2FyYmFnZSBmYWtl"
  }
}
{
  "id": 26278763,
  "customerId": 85477283,
  "documentFolderId": 69526,
  "uniqueIdentifier": "Test Document 123",
  "name": "Test File",
  "customerFacingName": null,
  "fileName": "TestFileName.txt",
  "sizeInBytes": 12,
  "isImage": false,
  "isDeleted": false,
  "documentDated": "2017-12-31",
  "description": "Test File",
  "dateUploaded": "2023-06-15"
}

Post document associations

Use POST /v1/document-associations to associate the document with other objects in Sageworks.

{
  "id": 50929059,
  "documentId": 26865232,
  "objectType": "PortfolioLoan",
  "objectId": 57649024
}
{
  "id": 50929059,
  "documentId": 26865232,
  "objectType": "PortfolioLoan",
  "objectId": 57649024
}