{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"4a3a0753-104d-4234-b97f-8e86f9890357","name":"AI Foundry Public REST API","description":"\n\nAI Foundry Public REST API allow seamless and realtime integration from inside their business processes to the Agile Mortgages Platform. This collection provides a spec for the core set of API's to authenticate, add loan package, upload batches of documents, retrieve extracted metadata from those documents and download the processed PDF documents . Once we have an account setup for you, you can import this Postman Collection and test out the APIs\n\n    https://www.getpostman.com/collections/6336518bbe960f88c9c1 \n\n\n\n# Overview\n\nAI Foundry’s Agile Mortgage platform uses a microservices based architecture. Every API request is authenticated at the gateway layer. On behalf of the end user, the application\nclient first acquires an access token from the authentication service by presenting credentials. This\naccess token is then passed along with the API request in Authorization HTTP header. The JWT token,\nwhich contains the claims for the user, is then passed to backend microservices. Backend microservices\nthen use the information inside the JWT token for authorization purpose. The same JWT token is passed\nalong when one microservice communicates with another microservice.\n\n# Data Model Context\n\nAgile Mortgages represents the Loan as a package. Package is a container of related documents. In\naddition to the document set, packages can optionally contain metadata that conforms to a predefined\nschema and a set of rule-based agents that oversee the processing of document set. Agents are typically\nused to verify the completeness and integrity of the document set. The package metadata also defines\nadditional data items used by the platform to process the document set. Examples include classification\nmethod, confidence thresholds, delivery specifications, notification and the list of required document types. The document set associated with a package is constructed from one or more document batches. A\ndocument batch is a file that contains an ordered sequence of page images and defines one or more\ncomplete documents. The classification and segmentation process determine the document-type\nassociated with each page, and the location of document boundaries. Once the documents have been\nidentified the extraction task will extract and validate data elements using definitions provided by the document-types.\n\n# Authentication\n\nAI Foundry’s REST API’s require JSON Web Tokens (JWT) for Authentication. Customers can request AI\nFoundry’s authorization services for the Access Tokens. These Tokens can be set to expire based on\ncustomers specific authentication policy and a request for refresh can subsequently be sent. The request for an access token should have this in the JSON body\n\n     {\n       'client_id: ‘xxxxxx'\n       'username': 'name’,\n       'password': 'password’,\n       ‘client_secret’: ‘xxxxx_xxsass_sassdqdqwd_adada_’\n       ‘grant_type’: ‘password’\n     }\n\n\nIn response, the authorization service returns an access_token and a refresh_token that must be included in the header of every API call\n\n    {\n     \"access_token\": \"xxxxxxxxxxxxxxxxxxxxxxxx\",\n     \"token_type\": \"Bearer\",\n     \"expires_in\": 300,\n     \"scope\": \"email profile\",\n     “refresh_expires_in”: 1800,\n     \"refresh_token\": \"xxxaxsxaaasxaxasxaxaaxaaxasxax\",\n     “session_state”: \"xasxaaxaxaxaxsaxsaxasxaxax\"\n     }\n\n# Error Codes\n\nAgile Mortgages uses conventional HTTP response codes to indicate the success or failure of an API\nrequest such as 200 OK for success or 400 for Bad requests or 500 for internal server errors etc\n\n\n\n# Ref Package Schema \n\nBy default, loan packages are created with a reference JSON schema Customers can work with AI Foundry to define specialized\nschemas that meet their processing requirements. An example of a reference loan package schema is\nshown below\n\n\n    {\n    \"$schema\": \"http://json-schema.org/draft-04/schema\",\n    \"id\": \"http://aifoundry.com/schema/test-loan-schema.json\",\n    \"title\": \"Test MISMO Loan schema\",\n    \"description\": \"AIF loan definition for AMH\",\n    \"definitions\": {\n\n    \"_aifBorrowerIncomeDocs\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"taxpayerIdentifierType\": {\n          \"type\": \"string\",\n          \"default\": \" \",\n          \"enum\": [\n            \" \",\n            \"IndividualTaxpayerIdentificationNumber\",\n            \"SocialSecurityNumber\"\n          ]\n        },\n        \"taxpayerIdentifierValue\": {\n          \"type\": \"string\",\n          \"title\": \"Taxpayer Identifier Value\",\n          \"pattern\": \"^[0-9]{3}-[0-9]{2}-[0-9]{4}$\"\n        },\n        \"stackingOrder\": {\n          \"title\": \"Income Documents Stacking Order\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"IRSW2\",\n              \"IRSW9\",\n              \"PayStub\",\n              \"CreditReport\",\n              \"BankStatement:401K\",\n              \"BankStatement:CheckingAccount\",\n              \"BankStatement:MutualFundAccount\",\n              \"BankStatement:SavingAccount\",\n              \"BankStatement:StockAccount\"\n            ]\n          },\n          \"minItems\": 0,\n          \"uniqueItems\": true,\n          \"additionalItems\": false\n        }\n      },\n      \"required\": [\n        \"taxpayerIdentifierType\",\n        \"taxpayerIdentifierValue\",\n        \"stackingOrder\"\n      ]\n    },\n\n    \"_aifProcessingOptions\": {\n      \"title\": \"Package Processing Options\",\n      \"type\": \"object\",\n      \"properties\": {\n        \"classificationMethod\": {\n          \"type\": \"string\",\n          \"title\": \"Classification Method\",\n          \"enum\": [\n            \"visual\"\n          ],\n          \"default\": \"visual\"\n        },\n        \"processName\": {\n          \"type\": \"string\",\n          \"title\": \"Process Name\",\n          \"enum\": [\n            \"Batch_Process\"\n          ],\n          \"default\": \"Batch_Process\"\n        }\n      },\n      \"required\": [\n        \"classificationMethod\",\n        \"processName\"\n      ]\n    },\n    \"_aifExportOptions\": {\n      \"title\": \"Package Export Options\",\n      \"type\": \"object\",\n      \"properties\": {\n        \"documentNaming\": {\n          \"title\": \"Document Naming\",\n          \"type\": \"object\",\n          \"properties\": {\n            \"name\": {\n              \"title\": \"Name Parts\",\n              \"type\": \"array\",\n              \"items\": {\n                \"type\": \"string\",\n                \"enum\": [\n                  \"Client ID\",\n                  \"Loan Number\",\n                  \"Document Type\",\n                  \"Borrower Name\",\n                  \"Loan Type\",\n                  \"Number of Pages\",\n                  \"Creation Date\"\n                ]\n              },\n              \"uniqueItems\": true,\n              \"additionalItems\": false\n            },\n            \"separator\": {\n              \"title\": \"Part Separator\",\n              \"type\": \"string\",\n              \"enum\": [\n                \"-\",\n                \"_\"\n              ],\n              \"default\": \"_\",\n              \"uniqueItems\": true,\n              \"additionalItems\": false\n            }\n          },\n          \"additionalProperties\": false,\n          \"required\": [\n            \"nameParts\",\n            \"nameSeparator\"\n          ]\n        },\n        \"documentBundling\": {\n          \"title\": \"Document Bundling\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"Individual Documents\",\n            \"Single Document\",\n            \"Zip Archive\"\n          ],\n          \"uniqueItems\": true,\n          \"additionalItems\": false\n        },\n        \"borrowerDocuments\": {\n          \"title\": \"Borrower Documents\",\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/_aifBorrowerIncomeDocs\"\n          },\n          \"minItems\": 0\n        },\n        \"stackingOrder\": {\n          \"title\": \"Document Stacking Order\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"AppraisalReport\",\n              \"MICertificate\",\n              \"TitleCommitment\",\n              \"TitleInsurancePolicy\"\n            ]\n          },\n          \"minItems\": 0,\n          \"uniqueItems\": true,\n          \"additionalItems\": false\n        },\n        \"groupingIndicator\": {\n          \"title\": \"Grouping Option\",\n          \"type\": \"boolean\",\n          \"default\": true\n        },\n        \"folderGrouping\": {\n          \"title\": \"Folder Grouping\",\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"Client ID\",\n              \"Loan Number\",\n              \"Document Type\"\n            ]\n          },\n          \"minItems\": 0,\n          \"uniqueItems\": true,\n          \"additionalItems\": false\n        },\n        \"tagGrouping\": {\n          \"title\": \"Tag Grouping\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"BorrowerName\",\n            \"SSN\"\n          ]\n        }\n      },\n      \"required\": [\n        \"documentNaming\",\n        \"documentBundling\",\n        \"borrowerDocuments\",\n        \"stackingOrder\",\n        \"folderGrouping\"\n      ],\n      \"dependencies\": {\n        \"folderGrouping\": {\n          \"properties\": {\n            \"groupingIndicator\": {\n              \"enum\": [\n                true\n              ]\n            }\n          }\n        },\n        \"tagGrouping\": {\n          \"properties\": {\n            \"groupingIndicator\": {\n              \"enum\": [\n                false\n              ]\n            }\n          }\n        }\n      }\n    },\n    \"_aifMetadataItem\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"fieldLabel\": {\n          \"title\": \"AIF Field Label\",\n          \"type\": \"string\"\n        },\n        \"customerAlias\": {\n          \"title\": \"Custom Alias\",\n          \"type\": \"string\"\n        },\n        \"fieldValue\": {\n          \"title\": \"Field Value\",\n          \"type\": \"string\"\n        },\n        \"fieldTag\": {\n          \"title\": \"Field Tag\",\n          \"type\": \"string\"\n        },\n        \"mismoPath\": {\n          \"title\": \"MISMO Path\",\n          \"type\": \"string\"\n        },\n        \"fieldType\": {\n          \"title\": \"File Data Type\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"string\",\n            \"integer\",\n            \"date\",\n            \"boolean\",\n            \"percent\",\n            \"decimal\"\n          ],\n          \"uniqueItems\": true,\n          \"additionalItems\": false\n        }\n      },\n      \"required\": [\n        \"fieldLabel\",\n        \"customerAlias\",\n        \"fieldValue\"\n      ]\n    }\n      },\n    \"type\": \"object\",\n    \"properties\": {\n    \"clientId\": {\n      \"title\": \"Client ID\",\n      \"type\": \"string\"\n    },\n    \"loanNumber\": {\n      \"title\": \"Loan Number\",\n      \"type\": \"string\"\n    },\n    \"borrowerName\": {\n      \"title\": \"Borrower Name\",\n      \"type\": \"string\"\n    },\n    \"loanType\": {\n      \"type\": \"string\",\n      \"title\": \"Loan Type\",\n      \"enum\": [\n        \"Conventional\",\n        \"VA\",\n        \"FHA\",\n        \"USDA\",\n        \"Other\"\n      ],\n      \"default\": \"Conventional\"\n    },\n    \"priorityId\": {\n      \"title\": \"Priority ID\",\n      \"type\": \"string\"\n    },\n    \"requiredDocuments\": {\n      \"title\": \"Required Documents\",\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\",\n        \"enum\": [\n          \"14FamilyRider\",\n          \"203k_Documents\",\n          \"411_Report\",\n          \"AdjustableRateRider\",\n          \"Affidavit_Other\",\n          \"AffiliatedBusinessDisclosure\",\n          \"AffiliateSharingOptOutNotice\",\n          \"BankStatements\",\n          \"GiftLetter\",\n          \"PayStub\",\n          \"IRSW2\"\n        ]\n      },\n      \"uniqueItems\": true,\n      \"additionalItems\": false,\n      \"default\": [\n        \"BankStatement\",\n        \"IRSW2\",\n        \"PayStub\"\n      ]\n    },\n    \"processingOptions\": {\n      \"$ref\": \"#/definitions/_aifProcessingOptions\"\n    },\n    \"loanMetadata\": {\n      \"type\": \"array\",\n      \"title\": \"Loan Record Fields\",\n      \"items\": {\n        \"$ref\": \"#/definitions/_aifMetadataItem\"\n      },\n      \"minItems\": 0\n    },\n    \"exportOptions\": {\n       \"$ref\": \"#/definitions/_aifExportOptions\"\n    }\n    },\n    \"required\": [\n     \"loanNumber\",\n     \"processingOptions\",\n     \"exportOptions\"\n    ]\n    }\n","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"3751634","collectionId":"4a3a0753-104d-4234-b97f-8e86f9890357","publishedId":"SVSLpTDh","public":true,"publicUrl":"https://api-docs.agilemortgages.com","privateUrl":"https://go.postman.co/documentation/3751634-4a3a0753-104d-4234-b97f-8e86f9890357","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"F99F1F"},"documentationLayout":"classic-double-column","version":"8.10.0","publishDate":"2019-07-17T22:38:16.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":"https://agilemortgages.com/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://api-docs.agilemortgages.com/view/metadata/SVSLpTDh"}