### User Created Webhook Example (JSON) This JSON example details the payload for a 'user_created' webhook. It includes user information such as name, type, and borrower details. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "user": "/fake/path/to/user" }, "event": "user_created", "event_info": { "name": "Name", "user_type": "USER_BORROWER", "user_borrower": "User borrower" } } ``` -------------------------------- ### Organization Created Webhook Example (JSON) This JSON example represents the payload for an 'organization_created' webhook. It contains general webhook information and specific details about the newly created organization. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "organization": "/fake/path/to/organization" }, "event": "organization_created", "event_info": { "name": "Organization Name" } } ] } ``` -------------------------------- ### Account Assignment Created Webhook Example This example shows the JSON payload for an 'account_assignment_created' webhook event. It includes details about the assignee and assignor. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "assignments": "/fake/path/to/assignments" }, "event": "account_assignment_created", "event_info": { "assignee_type": "Assignee type", "assignee_name": "Assignee name", "assignor_type": "Assignor type", "assignor_name": "Assignor name" } } ] } ``` -------------------------------- ### User First Login Webhook Notification Example This JSON example represents the payload for a 'user_first_login' webhook. It contains information about the user's initial login event and associated resource links. This webhook is triggered only on a user's very first successful login. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "user": "/fake/path/to/user" }, "event": "user_first_login", "event_info": { "name": "Name" } } ] } ``` -------------------------------- ### State License Created Webhook Notification Example This example shows the JSON payload for a state license creation event. It contains information about the newly created state license, including its state. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "state_license": "/fake/path/to/state_license" }, "event": "state_license_created", "event_info": { "state": "AA" } } ] } ``` -------------------------------- ### List Doc Package Orders for a Loan (Ruby) This Ruby example utilizes the 'net/http' library to make a GET request to the API endpoint for listing document package orders. It specifies the loan ID in the URL and includes the necessary 'accept' header for JSON. Basic error handling is present. ```ruby require 'net/http' require 'uri' loan_id = 'your_loan_id' # Replace with the actual loan ID uri = URI.parse("https://api.ncinomortgage.com/loans/#{loan_id}/doc_package_orders") response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http| request = Net::HTTP::Get.new(uri) request['accept'] = 'application/json' http.request(request) end if response.is_a?(Net::HTTPSuccess) puts response.body else puts "Error: #{response.code} #{response.message}" end ``` -------------------------------- ### Retrieve Company State Licenses (Ruby) A Ruby code example for retrieving company state licenses via the API. This snippet illustrates making an HTTP GET request. ```ruby require 'uri' require 'net/http' url = URI("https://api.ncinomortgage.com/companies/company_id/state_licenses") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["accept"] = "application/json" response = http.request(request) puts response.read_body ``` -------------------------------- ### Loan Updated Webhook Example This example shows the JSON payload for a webhook notification when a loan is updated. It contains the loan's unique identifier and timestamp. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "loan": "/fake/path/to/loan" }, "event": "loan_updated", "event_info": { "loan_number": "Loan number" } } ] } ``` -------------------------------- ### Retrieve All Loan Applications (Node.js) Example using Node.js to fetch all loan application records. This snippet utilizes the 'axios' library for making HTTP requests and assumes a basic setup for API interaction. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://api.ncinomortgage.com/loan_applications', headers: { 'accept': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### State License Updated Webhook Notification Example This example shows the JSON payload for a state license update event. It contains information about the updated state license, including the state. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "state_license": "/fake/path/to/state_license" }, "event": "state_license_updated", "event_info": { "state": "AA" } } ] } ``` -------------------------------- ### GET /websites/developer_ncinomortgage_mortgage/company_state_licenses Retrieves all state licenses for a given company. ```APIDOC ## GET /websites/developer_ncinomortgage_mortgage/company_state_licenses ### Description This endpoint will retrieve all state licenses for the given company. ### Method GET ### Endpoint /websites/developer_ncinomortgage_mortgage/company_state_licenses ### Parameters #### Query Parameters - **companyId** (string) - Required - The unique identifier for the company. ### Response #### Success Response (200) - **licenses** (array) - A list of state licenses associated with the company. - **state** (string) - The state where the license is valid. - **licenseNumber** (string) - The license number. - **expirationDate** (string) - The expiration date of the license (YYYY-MM-DD). #### Response Example ```json { "licenses": [ { "state": "CA", "licenseNumber": "1234567", "expirationDate": "2025-12-31" }, { "state": "NY", "licenseNumber": "9876543", "expirationDate": "2024-06-30" } ] } ``` ``` -------------------------------- ### User Updated Webhook Notification Example This example shows the JSON structure for a user updated event notification. It details the event, timestamp, and user information. This is part of the User Webhooks. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "user": "/fake/path/to/user" }, "event": "user_updated", "event_info": { "name": "Name", "user_type": "USER_BORROWER" } } ] } ``` -------------------------------- ### GET /websites/developer_ncinomortgage_mortgage/company_state_license_template Retrieves a state license template for the specified company. ```APIDOC ## GET /websites/developer_ncinomortgage_mortgage/company_state_license_template ### Description This endpoint will retrieve a state license template for the given <>. ### Method GET ### Endpoint /websites/developer_ncinomortgage_mortgage/company_state_license_template ### Parameters #### Query Parameters - **company_id** (string) - Required - The unique identifier for the company. ### Request Example ``` GET /websites/developer_ncinomortgage_mortgage/company_state_license_template?company_id=12345 ``` ### Response #### Success Response (200) - **template_name** (string) - The name of the state license template. - **fields** (array) - An array of field objects, where each object contains details about a license field. - **field_name** (string) - The name of the field. - **field_type** (string) - The data type of the field (e.g., text, date, dropdown). - **required** (boolean) - Indicates if the field is mandatory. #### Response Example ```json { "template_name": "California Mortgage Lender License", "fields": [ { "field_name": "License Number", "field_type": "text", "required": true }, { "field_name": "Issuance Date", "field_type": "date", "required": false } ] } ``` ``` -------------------------------- ### User Enabled Webhook Notification Example This JSON example illustrates the payload for a 'user_enabled' webhook. It provides details about the user whose account has been re-enabled, including relevant links. This event signifies a user account becoming active again. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "user": "/fake/path/to/user" }, "event": "user_enabled", "event_info": { "name": "Name", "user_type": "USER_BORROWER" } } ] } ``` -------------------------------- ### State License Deleted Webhook Notification Example This example illustrates the JSON payload for a state license deletion event. It provides details about the deleted state license, including the state it was associated with. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "state_licenses": "/fake/path/to/state_licenses" }, "event": "state_license_deleted", "event_info": { "state": "AA" } } ] } ``` -------------------------------- ### Retrieve Company Links using Python This Python example uses the 'requests' library to fetch company links. It sends a GET request to the API endpoint with the 'accept' header set to 'application/json'. Ensure the 'requests' library is installed. ```python import requests url = "https://api.ncinomortgage.com/companies/company_id/links" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Retrieve Borrower Accounts using Node.js This snippet shows how to fetch all borrower accounts using Node.js with the 'axios' library. It makes a GET request to the specified API endpoint and includes the 'accept' header. The response is logged to the console. This example assumes 'axios' is installed. ```javascript const axios = require('axios'); axios.get('https://api.ncinomortgage.com/users/borrowers', { headers: { 'accept': 'application/json' } }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error); }); ``` -------------------------------- ### POST /websites/developer_ncinomortgage_mortgage/company_state_license_templates Creates a state license template for a given company. ```APIDOC ## POST /websites/developer_ncinomortgage_mortgage/company_state_license_templates ### Description This endpoint will create a state license template for the given <>. ### Method POST ### Endpoint /websites/developer_ncinomortgage_mortgage/company_state_license_templates ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **company_id** (string) - Required - The ID of the company for which to create the template. - **state** (string) - Required - The state for which the license template is being created. - **template_name** (string) - Required - The name of the license template. - **fields** (array) - Optional - An array of field objects defining the template structure. - **field_name** (string) - Required - The name of the field. - **field_type** (string) - Required - The type of the field (e.g., 'text', 'number', 'date'). - **is_required** (boolean) - Optional - Whether the field is required. ### Request Example ```json { "company_id": "comp_123", "state": "CA", "template_name": "Mortgage Lender License", "fields": [ { "field_name": "License Number", "field_type": "text", "is_required": true }, { "field_name": "Expiration Date", "field_type": "date", "is_required": true } ] } ``` ### Response #### Success Response (201 Created) - **template_id** (string) - The unique identifier for the created template. - **company_id** (string) - The ID of the company. - **state** (string) - The state for which the template is created. - **template_name** (string) - The name of the template. - **fields** (array) - The fields defined in the template. #### Response Example ```json { "template_id": "tmpl_abc789", "company_id": "comp_123", "state": "CA", "template_name": "Mortgage Lender License", "fields": [ { "field_name": "License Number", "field_type": "text", "is_required": true }, { "field_name": "Expiration Date", "field_type": "date", "is_required": true } ] } ``` #### Error Response (400 Bad Request) - **error** (string) - A message describing the error. #### Error Response Example ```json { "error": "Missing required field: company_id" } ``` ``` -------------------------------- ### Retrieve All Webhook Records using Python This Python snippet uses the 'requests' library to retrieve webhook records. It sends a GET request to the API endpoint, specifying the 'accept' header. Ensure the 'requests' library is installed (`pip install requests`). ```python import requests url = "https://api.ncinomortgage.com/webhooks" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Retrieve All Webhook Records using Node.js This Node.js snippet shows how to fetch webhook records using the 'node-fetch' library. It makes a GET request to the specified API endpoint and includes the necessary 'accept' header. Ensure 'node-fetch' is installed (`npm install node-fetch`). ```javascript import fetch from 'node-fetch'; const url = "https://api.ncinomortgage.com/webhooks"; fetch(url, { method: "GET", headers: { "accept": "application/json" } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error(error)); ``` -------------------------------- ### Create Doc Package Order (BETA) Creates a doc package order for a loan. This endpoint is currently in beta and its functionality may change. ```APIDOC ## POST /websites/developer_ncinomortgage_mortgage/docpackageorders ### Description Creates a doc package order for a loan. This endpoint is currently in beta and its functionality may change without notice. Use in production is not recommended. ### Method POST ### Endpoint /websites/developer_ncinomortgage_mortgage/docpackageorders ### Parameters #### Query Parameters N/A #### Request Body This endpoint does not currently define a request body. Please refer to future documentation for specific requirements. ### Request Example ```json { "message": "Request body structure to be defined." } ``` ### Response #### Success Response (201 Created) This endpoint is under construction and does not yet define success responses. Please refer to future documentation. #### Response Example ```json { "message": "Response structure to be defined." } ``` #### Error Response N/A ``` -------------------------------- ### Retrieve Borrower Accounts using Python This Python snippet shows how to retrieve borrower accounts using the 'requests' library. It sends a GET request to the API endpoint with the 'Accept' header set to 'application/json'. The JSON response is then printed. Ensure the 'requests' library is installed (`pip install requests`). ```python import requests url = "https://api.ncinomortgage.com/users/borrowers" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Retrieve Borrower Accounts using Ruby This Ruby snippet demonstrates how to retrieve borrower accounts using the 'httparty' gem. It performs a GET request to the API endpoint and sets the 'Accept' header to 'application/json'. The response body is then printed to the console. Ensure 'httparty' is installed (`gem install httparty`). ```ruby require 'httparty' response = HTTParty.get('https://api.ncinomortgage.com/users/borrowers', headers: { 'Accept' => 'application/json' }) puts response.body ``` -------------------------------- ### Create Loan Application Record (BETA) Creates a new loan application record. This endpoint is in beta and may change. ```APIDOC ## POST /websites/developer_ncinomortgage_mortgage/loan_applications ### Description Creates a new loan application record. Param keys with `_INDEX` should replace `_INDEX` with a number 1-5 for each entity being verified (e.g. `vogg_gift_amount_1` for first gift, `vogg_gift_amount_2` for second gift). ### Method POST ### Endpoint /websites/developer_ncinomortgage_mortgage/loan_applications ### Parameters #### Query Parameters - **vogg_gift_amount_1** (number) - Optional - The amount of the first gift. - **vogg_gift_amount_2** (number) - Optional - The amount of the second gift. ### Request Example ```json { "loan_type": "Conventional", "borrower_first_name": "John", "borrower_last_name": "Doe", "vogg_gift_amount_1": 10000, "vogg_gift_amount_2": 5000 } ``` ### Response #### Success Response (201) - **application_id** (string) - The unique identifier for the created loan application. - **status** (string) - The current status of the loan application. #### Response Example ```json { "application_id": "app_12345abcde", "status": "Pending" } ``` ``` -------------------------------- ### Retrieve all loan borrowers (Node.js) Node.js example using the 'axios' library to make a GET request to the borrowers endpoint. It includes setting the authorization header with a Bearer token and handling the response. ```javascript const axios = require('axios'); const loanId = 'your_loan_id'; const token = 'your_oauth2_token'; axios.get(`https://api.ncinomortgage.com/loans/${loanId}/borrowers`, { headers: { 'Authorization': `Bearer ${token}`, 'Accept': 'application/json' } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error fetching borrowers:', error); }); ``` -------------------------------- ### POST /loan_applications Creates a new loan application record. This endpoint is currently in beta and subject to change. It supports creating loan applications with details for up to five entities, using `_INDEX` placeholders for multiple entries. ```APIDOC ## POST /loan_applications ### Description Create a loan application record. Param keys with `_INDEX` should replace `_INDEX` with a number 1-5 for each entity being verified (e.g. `vogg_gift_amount_1` for first gift, `vogg_gift_amount_2` for second gift). > **Note:** This endpoint is under construction and in beta. Functionality may change without notice, support is limited, and use in production is not recommended. Your feedback is appreciated. ### Method POST ### Endpoint /loan_applications #### Query Parameters - **X-Api-Version** (string) - Optional - Specify API version, for example '1.0'. By default, the version configured in the company settings is used. #### Request Body - **loanApplication** (object) - Required - The loan application data. - **borrower** (object) - Required - Borrower details. - **firstName** (string) - Required - Borrower's first name. - **lastName** (string) - Required - Borrower's last name. - **email** (string) - Required - Borrower's email address. - **loanDetails** (object) - Required - Loan specific details. - **loanAmount** (number) - Required - The requested loan amount. - **loanPurpose** (string) - Required - The purpose of the loan. ### Request Example ```json { "loanApplication": { "borrower": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com" }, "loanDetails": { "loanAmount": 500000, "loanPurpose": "Purchase" } } } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the created loan application. - **status** (string) - The current status of the loan application. #### Response Example ```json { "id": "app_12345abc", "status": "Pending" } ``` #### Error Responses - **400 Bad Request** - The request was malformed or invalid. - **401 Unauthorized** - Authentication failed or was not provided. - **403 Forbidden** - The authenticated user does not have permission to perform this action. - **409 Conflict** - A loan application already exists for the specified borrower. - **412 Precondition Failed** - No default loan officer is set for the organization. - **500 Internal Server Error** - An unexpected error occurred on the server. ``` -------------------------------- ### Retrieve all loan borrowers (Ruby) Ruby example using the 'httparty' gem to make a GET request for loan borrowers. It demonstrates setting the authorization header and handling potential errors during the API call. ```ruby require 'httparty' loan_id = 'your_loan_id' token = 'your_oauth2_token' url = "https://api.ncinomortgage.com/loans/#{loan_id}/borrowers" response = HTTParty.get(url, headers: { 'Authorization' => "Bearer #{token}", 'Accept' => 'application/json' }) if response.success? puts response.parsed_response else puts "Error: #{response.code}" puts response.body end ``` -------------------------------- ### Loan Model (Preview) Provides a preview of the loan model, including borrower and property details. ```APIDOC ## GET /loans/preview ### Description Retrieves a preview of the loan model, containing essential borrower and property information. ### Method GET ### Endpoint /loans/preview ### Parameters #### Query Parameters - **borrower_email** (string) - Optional - Primary borrower's email. ### Response #### Success Response (200) - **loan_id** (string) - Unique identifier for the loan. - **borrower_email** (string) - Primary borrower's email. - **property_address** (string) - The address of the property associated with the loan. #### Response Example ```json { "loan_id": "loan_12345", "borrower_email": "borrower@example.com", "property_address": "123 Main St, Anytown, USA" } ``` ``` -------------------------------- ### Retrieve all loan borrowers (cURL) Example cURL request to fetch all borrowers for a given loan ID. This demonstrates the basic GET request structure, URL, and required headers for authentication and content type. ```shell curl --request GET \ --url https://api.ncinomortgage.com/loans/loan_id/borrowers \ --header 'accept: application/json' ``` -------------------------------- ### Retrieve Branch State Licenses (Node.js) Example Node.js code snippet to retrieve all branch state licenses using the 'axios' library. It makes a GET request to the API endpoint and handles the response. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://api.ncinomortgage.com/branches/{branch_id}/state_licenses', headers: { 'accept': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### List Doc Package Orders for a Loan (Python) This Python example uses the 'requests' library to fetch document package orders. It constructs the API URL with the loan ID and sets the 'accept' header. The code includes error handling for the HTTP request and prints the JSON response. ```python import requests loan_id = 'your_loan_id' # Replace with the actual loan ID api_url = f"https://api.ncinomortgage.com/loans/{loan_id}/doc_package_orders" headers = { 'accept': 'application/json' } try: response = requests.get(api_url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes data = response.json() print(data) except requests.exceptions.RequestException as e: print(f"Error fetching doc package orders: {e}") ``` -------------------------------- ### Create Loan Borrower Record (BETA) - OpenAPI This OpenAPI definition describes an endpoint to create a loan borrower record. It is currently in beta, with limited support and not recommended for production use. The endpoint requires a loan ID and accepts a JSON request body conforming to the LoanBorrowerPostBody schema. ```json { "info": { "title": "Loans", "description": "API for interacting with doc package orders, loan borrower verifications, loan borrowers, and loans in the nCino Mortgage system", "version": "1.0", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, "servers": [ { "url": "https://api.ncinomortgage.com", "description": "Production server" } ], "security": [ { "OAuth2": [] } ], "openapi": "3.0.0", "paths": { "/loans/{loan_id}/borrowers": { "post": { "tags": [ "Loan Borrowers" ], "operationId": "loan_borrowers-create", "parameters": [ { "name": "loan_id", "description": "Loan ID.", "required": true, "in": "path", "schema": { "type": "string", "format": "uuid" } }, { "$ref": "#/components/parameters/ApiVersionHeader" } ], "responses": { "201": { "description": "Created loan borrower", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResourceCreated" } } }, "headers": { "X-Api-Version": { "$ref": "#/components/headers/ApiVersionResponseHeader" }, "X-Api-Supported-Versions": { "$ref": "#/components/headers/ApiSupportedVersionsResponseHeader" } } }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "412": { "description": "Resource is in an invalid state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSet" } } }, "headers": { "X-Api-Version": { "$ref": "#/components/headers/ApiVersionResponseHeader" }, "X-Api-Supported-Versions": { "$ref": "#/components/headers/ApiSupportedVersionsResponseHeader" } } }, "500": { "$ref": "#/components/responses/InternalServerError" } }, "description": "> 🚧 Under construction\n> **This endpoint is in beta.** Functionality may change without notice, support is limited, and use in production is not recommended. Your feedback is appreciated.\n\nThis endpoint will create a <> record.", "summary": "🚧 Create a loan borrower record (BETA)", "requestBody": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoanBorrowerPostBody" } } } } } } }, "tags": [ { "name": "Loan Borrowers", "description": "Endpoints pertaining to <>s" } ], "components": { "parameters": { "ApiVersionHeader": { "name": "X-Api-Version", "description": "Specify API version, for example '1.0'. By default, the version configured in the company settings is used.", "required": false, "in": "header", "schema": { "type": "string" } } }, "responses": { "BadRequestError": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSet" } } }, "headers": { "X-Api-Version": { "$ref": "#/components/headers/ApiVersionResponseHeader" }, "X-Api-Supported-Versions": { "$ref": "#/components/headers/ApiSupportedVersionsResponseHeader" } } }, "UnauthorizedError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSet" } } }, "headers": { "X-Api-Version": { "$ref": "#/components/headers/ApiVersionResponseHeader" }, "X-Api-Supported-Versions": { "$ref": "#/components/headers/ApiSupportedVersionsResponseHeader" } } }, "ForbiddenError": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorSet" } } }, "headers": { "X-Api-Version": { "$ref": "#/components/headers/ApiVersionResponseHeader" }, "X-Api-Supported-Versions": { "$ref": "#/components/headers/ApiSupportedVersionsResponseHeader" } } } } } } ``` -------------------------------- ### Loan.Preview Model A preview of loan information, including the primary borrower's name and email. ```APIDOC ## Loan.Preview Model ### Description Provides a summarized view of a loan, including details about the primary borrower. ### All Of - **Loan** - **object** ### Properties - **primary_borrower_name** (string, nullable: true) - Optional - Primary borrower's name. - **primary_borrower_email** (string, nullable: true) - Optional - Primary borrower's email. ``` -------------------------------- ### Retrieve Company State License Templates (Ruby) A Ruby example using the 'httparty' gem to make a GET request for state license templates. It demonstrates setting the API endpoint and the 'accept' header. ```ruby require 'httparty' company_id = 'your_company_id' # Replace with the actual company ID url = "https://api.ncinomortgage.com/companies/#{company_id}/state_license_templates" response = HTTParty.get(url, headers: { 'accept' => 'application/json' }) if response.success? puts response.parsed_response else puts "Error fetching state license templates: #{response.code} - #{response.message}" end ``` -------------------------------- ### Retrieve Branch State Licenses (PHP) Example PHP code snippet to retrieve all branch state licenses using cURL. This script sends a GET request to the API endpoint and outputs the JSON response. ```php "https://api.ncinomortgage.com/branches/{branch_id}/state_licenses", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "accept: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); cert_close($curl); if ($err) { echo "cURL Error #" . $err; } else { echo $response; } ?> ``` -------------------------------- ### POST /user_first_login Receives a webhook notification when a user first logs in. ```APIDOC ## POST /user_first_login ### Description A webhook notification sent out when a user first logs in. ### Method POST ### Endpoint /user_first_login ### Request Body - **_id** (string) - Required - Unique identifier for the webhook event. - **_timestamp** (string) - Required - Timestamp of the event. - **events** (array) - Required - List of events associated with the webhook. - **_id** (string) - Required - Unique identifier for the event. - **_timestamp** (string) - Required - Timestamp of the event. - **_links** (object) - Optional - Links to related resources. - **user** (string) - URL to the user resource. - **event** (string) - Required - The type of event, "user_first_login". - **event_info** (object) - Optional - Information about the event. - **name** (string) - The name of the user. - **user_type** (string) - The type of the user (e.g., "USER_BORROWER"). ### Request Example ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "user": "/fake/path/to/user" }, "event": "user_first_login", "event_info": { "name": "Name", "user_type": "USER_BORROWER" } } ] } ``` ### Response #### Success Response (200) (Details for success response are not provided in the input, typically a confirmation of receipt.) #### Response Example ```json { "message": "Webhook received successfully" } ``` ``` -------------------------------- ### Retrieve Branch State Licenses (Ruby) Example Ruby code snippet to retrieve all branch state licenses using the 'httparty' gem. It makes a GET request to the API endpoint and displays the response body. ```ruby require 'httparty' url = 'https://api.ncinomortgage.com/branches/{branch_id}/state_licenses' headers = { 'accept' => 'application/json' } response = HTTParty.get(url, headers: headers) puts response.body ``` -------------------------------- ### User Created Webhook Notification This example shows the basic structure of a webhook notification when a user is created. It includes event details. ```json { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "events": [ { "_id": "00000000-0000-0000-0000-000000000000", "_timestamp": "1989-08-23T00:00:00+00:00", "_links": { "user": "/fake/path/to/user" }, "event": "user_created", "event_info": { "user_id": "00000000-0000-0000-0000-000000000000" } } ] } ``` -------------------------------- ### Retrieve Branch State Licenses (Python) Example Python code snippet to retrieve all branch state licenses using the 'requests' library. It sends a GET request to the API endpoint and prints the JSON response. ```python import requests url = "https://api.ncinomortgage.com/branches/{branch_id}/state_licenses" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### POST /websites/developer_ncinomortgage_mortgage/borrowers/{borrowerId}/actions This endpoint allows a variety of actions to be taken on a borrower account. Available actions include sending a welcome email, reassigning a loan officer, assigning a partner, or unassigning a partner. ```APIDOC ## POST /websites/developer_ncinomortgage_mortgage/borrowers/{borrowerId}/actions ### Description This endpoint allows a variety of actions to be taken on a borrower account. Available actions include sending a welcome email, reassigning a loan officer, assigning a partner, or unassigning a partner. ### Method POST ### Endpoint `/websites/developer_ncinomortgage_mortgage/borrowers/{borrowerId}/actions` ### Parameters #### Path Parameters - **borrowerId** (string) - Required - The unique identifier of the borrower account. #### Query Parameters None #### Request Body - **action** (string) - Required - The action to perform on the borrower account. Must be one of: `SEND_WELCOME_EMAIL`, `REASSIGN_LO`, `ASSIGN_PARTNER`, `REMOVE_PARTNER`. - **[Action-specific fields]** - Required/Optional - Fields specific to the chosen action (e.g., `loanOfficerId` for `REASSIGN_LO`). ### Request Example ```json { "action": "REASSIGN_LO", "loanOfficerId": "lo_12345" } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the action was performed. #### Response Example ```json { "message": "Borrower account successfully updated." } ``` #### Error Responses - **400 Bad Request**: Returned if the request body is invalid or missing required fields. - **401 Unauthorized**: Returned if the user is not authenticated. - **403 Forbidden**: Returned if the user does not have permission to perform the action. - **404 Not Found**: Returned if the specified borrower account does not exist. - **500 Internal Server Error**: Returned if an unexpected error occurs on the server. ``` -------------------------------- ### Retrieve Branch State Licenses (cURL) Example cURL request to retrieve all branch state licenses. This command demonstrates how to make a GET request to the specified URL, including the 'accept' header for JSON response. ```shell curl --request GET \ --url https://api.ncinomortgage.com/branches/branch_id/state_licenses \ --header 'accept: application/json' ``` -------------------------------- ### Retrieve Company Links using Node.js This Node.js snippet shows how to fetch company links using the 'node-fetch' library. It makes a GET request to the API endpoint and includes the necessary 'accept' header. Ensure 'node-fetch' is installed. ```javascript import fetch from 'node-fetch'; const url = "https://api.ncinomortgage.com/companies/company_id/links"; fetch(url, { method: "GET", headers: { "accept": "application/json" } }) .then(response => response.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ```