{
  "info": {
    "name": "nCino eVault API",
    "description": "All routes are currently in development and should be treated as such.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_postman_id": "evault-ncino-collection"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{accessToken}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Auth",
      "description": "OAuth2 token endpoint (POST /oauth/auth_token). Run 'Get Access Token' first; it stores {{accessToken}} which every other request uses via collection-level Bearer auth.",
      "item": [
        {
          "name": "Get Access Token",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('token request succeeded', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "var res = pm.response.json();",
                  "if (res.access_token) {",
                  "    pm.collectionVariables.set('accessToken', res.access_token);",
                  "}",
                  "if (res.refresh_token) {",
                  "    pm.collectionVariables.set('refreshToken', res.refresh_token);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "username",
                  "value": "{{clientId}}",
                  "type": "string"
                },
                {
                  "key": "password",
                  "value": "{{clientSecret}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "authorization_code",
                  "type": "text"
                },
                {
                  "key": "code",
                  "value": "{{authCode}}",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/oauth/auth_token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "oauth",
                "auth_token"
              ]
            },
            "description": "Exchanges client credentials (Basic auth: clientId/clientSecret) plus the org API client code for an access token. On success the access_token and refresh_token are saved to collection variables automatically."
          },
          "response": []
        },
        {
          "name": "Refresh Access Token",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('token request succeeded', function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "",
                  "var res = pm.response.json();",
                  "if (res.access_token) {",
                  "    pm.collectionVariables.set('accessToken', res.access_token);",
                  "}",
                  "if (res.refresh_token) {",
                  "    pm.collectionVariables.set('refreshToken', res.refresh_token);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "username",
                  "value": "{{clientId}}",
                  "type": "string"
                },
                {
                  "key": "password",
                  "value": "{{clientSecret}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "refresh_token",
                  "type": "text"
                },
                {
                  "key": "refresh_token",
                  "value": "{{refreshToken}}",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/oauth/auth_token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "oauth",
                "auth_token"
              ]
            },
            "description": "Uses the stored refresh_token to obtain a new access_token. Requires the same Basic auth (clientId/clientSecret)."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Connectivity",
      "item": [
        {
          "name": "Verifies API connectivity",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/connectivity-check",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "connectivity-check"
              ]
            },
            "description": "Lightweight connection/health check. Requires a valid <Glossary>bearer token</Glossary> but no specific permission — a 200 response confirms the caller's credentials are valid and can reach the eVault API. No environment segment or identifiers are needed."
          },
          "response": []
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Ensure a valid access token exists before any request in this folder.",
              "// Fetches one from POST {{baseUrl}}/oauth/auth_token only when missing or expired.",
              "",
              "function tokenExpired(token) {",
              "    try {",
              "        var payload = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');",
              "        while (payload.length % 4) { payload += '='; }",
              "        var decoded = JSON.parse(atob(payload));",
              "        if (!decoded.exp) { return false; }",
              "        // refresh 30s early to avoid edge-of-expiry failures",
              "        return (Date.now() / 1000) >= (decoded.exp - 30);",
              "    } catch (e) {",
              "        return true; // unparseable -> fetch a fresh one",
              "    }",
              "}",
              "",
              "var token = pm.collectionVariables.get('accessToken');",
              "if (token && !tokenExpired(token)) {",
              "    return; // existing token still good",
              "}",
              "",
              "var clientId = pm.collectionVariables.get('clientId');",
              "var clientSecret = pm.collectionVariables.get('clientSecret');",
              "var basic = CryptoJS.enc.Base64.stringify(",
              "    CryptoJS.enc.Utf8.parse(clientId + ':' + clientSecret)",
              ");",
              "",
              "pm.sendRequest({",
              "    url: pm.collectionVariables.get('baseUrl') + '/oauth/auth_token',",
              "    method: 'POST',",
              "    header: {",
              "        'Authorization': 'Basic ' + basic,",
              "        'Content-Type': 'application/x-www-form-urlencoded'",
              "    },",
              "    body: {",
              "        mode: 'urlencoded',",
              "        urlencoded: [",
              "            { key: 'grant_type', value: 'authorization_code' },",
              "            { key: 'code', value: pm.collectionVariables.get('authCode') }",
              "        ]",
              "    }",
              "}, function (err, res) {",
              "    if (err) {",
              "        console.log('[eVault] token request failed:', err);",
              "        return;",
              "    }",
              "    if (res.code !== 200) {",
              "        console.log('[eVault] token request returned', res.code, res.text());",
              "        return;",
              "    }",
              "    try {",
              "        var json = res.json();",
              "        if (json.access_token) { pm.collectionVariables.set('accessToken', json.access_token); }",
              "        if (json.refresh_token) { pm.collectionVariables.set('refreshToken', json.refresh_token); }",
              "    } catch (e) {",
              "        console.log('[eVault] could not parse token response:', e);",
              "    }",
              "});"
            ]
          }
        }
      ]
    },
    {
      "name": "Enotes",
      "item": [
        {
          "name": "Create an eNote",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes"
              ]
            },
            "description": "Creates a new <Glossary>eNote</Glossary> in eVault from the supplied borrower, property, and loan details along with the eNote document data (the eNote file and its PDF rendering).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"lienType\": \"FirstLien\",\n  \"borrowerFirstName\": \"Simple\",\n  \"borrowerLastName\": \"Nexus\",\n  \"streetAddress\": \"123 SimpleNexus Ln\",\n  \"city\": \"Lehi\",\n  \"state\": \"NV\",\n  \"zip\": \"12345\",\n  \"loanNumber\": \"0292364\",\n  \"enoteData\": \"iVBORw0KGgoAAAANSUhEUgAAAWIAAAFiCAYAAADMXNJ6AAADx0lEQVR42u3UQQ0AAAgDMeZfNOCChLRzsMelegfAmQgxgBADCLEbAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGECIhRhAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQYQYiEGEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhB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language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get an eNote",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}"
              ]
            },
            "description": "Retrieves the full details and current status of an <Glossary>eNote</Glossary> by its guid, including its registration status, named parties, and <Glossary>audit log</Glossary> entries."
          },
          "response": []
        },
        {
          "name": "Get an eNote smartdoc",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/smartdoc",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "smartdoc"
              ]
            },
            "description": "Retrieves the <Glossary>smartdoc</Glossary> (SMART Doc®) representation of an <Glossary>eNote</Glossary> by its guid."
          },
          "response": []
        },
        {
          "name": "Get an eNote pdf",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/pdf",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "pdf"
              ]
            },
            "description": "Retrieves the PDF rendering of an <Glossary>eNote</Glossary> by its guid."
          },
          "response": []
        },
        {
          "name": "Get an eNote audit log",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/audit-log",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "audit-log"
              ]
            },
            "description": "Retrieves the <Glossary>audit log</Glossary> for an <Glossary>eNote</Glossary> — the time-ordered record of events (registration, transfers, status changes, and so on) recorded against its <Glossary>electronic record</Glossary>."
          },
          "response": []
        },
        {
          "name": "Upload a document to an eNote",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/documents/upload",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "documents",
                "upload"
              ]
            },
            "description": "Uploads one or more supporting documents (such as an appraisal or title policy) and attaches them to an <Glossary>eNote</Glossary>.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"documents\": [\n    {\n      \"remoteId\": \"remote-doc-1\",\n      \"documentType\": \"AppraisalReport\",\n      \"contentType\": \"application/pdf\",\n      \"loanNumber\": \"0292364\",\n      \"name\": \"Document 1\",\n      \"data\": \"iVBORw0KGgoAAAANSUhEUgAAAWIAAAFiCAYAAADMXNJ6AAADx0lEQVR42u3UQQ0AAAgDMeZfNOCChLRzsMelegfAmQgxgBADCLEbAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGECIhRhAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQYQYiEGEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBhFiIAYQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGECIhRhAiAGE2A0AQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMIMRCDCDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgwgxAAIMYAQAyDEAEIMgBADCDEAQgzwwQDP0cK9V+cyWQAAAABJRU5ErkJggg==\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Ensure a valid access token exists before any request in this folder.",
              "// Fetches one from POST {{baseUrl}}/oauth/auth_token only when missing or expired.",
              "",
              "function tokenExpired(token) {",
              "    try {",
              "        var payload = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');",
              "        while (payload.length % 4) { payload += '='; }",
              "        var decoded = JSON.parse(atob(payload));",
              "        if (!decoded.exp) { return false; }",
              "        // refresh 30s early to avoid edge-of-expiry failures",
              "        return (Date.now() / 1000) >= (decoded.exp - 30);",
              "    } catch (e) {",
              "        return true; // unparseable -> fetch a fresh one",
              "    }",
              "}",
              "",
              "var token = pm.collectionVariables.get('accessToken');",
              "if (token && !tokenExpired(token)) {",
              "    return; // existing token still good",
              "}",
              "",
              "var clientId = pm.collectionVariables.get('clientId');",
              "var clientSecret = pm.collectionVariables.get('clientSecret');",
              "var basic = CryptoJS.enc.Base64.stringify(",
              "    CryptoJS.enc.Utf8.parse(clientId + ':' + clientSecret)",
              ");",
              "",
              "pm.sendRequest({",
              "    url: pm.collectionVariables.get('baseUrl') + '/oauth/auth_token',",
              "    method: 'POST',",
              "    header: {",
              "        'Authorization': 'Basic ' + basic,",
              "        'Content-Type': 'application/x-www-form-urlencoded'",
              "    },",
              "    body: {",
              "        mode: 'urlencoded',",
              "        urlencoded: [",
              "            { key: 'grant_type', value: 'authorization_code' },",
              "            { key: 'code', value: pm.collectionVariables.get('authCode') }",
              "        ]",
              "    }",
              "}, function (err, res) {",
              "    if (err) {",
              "        console.log('[eVault] token request failed:', err);",
              "        return;",
              "    }",
              "    if (res.code !== 200) {",
              "        console.log('[eVault] token request returned', res.code, res.text());",
              "        return;",
              "    }",
              "    try {",
              "        var json = res.json();",
              "        if (json.access_token) { pm.collectionVariables.set('accessToken', json.access_token); }",
              "        if (json.refresh_token) { pm.collectionVariables.set('refreshToken', json.refresh_token); }",
              "    } catch (e) {",
              "        console.log('[eVault] could not parse token response:', e);",
              "    }",
              "});"
            ]
          }
        }
      ]
    },
    {
      "name": "Audit Logs",
      "item": [
        {
          "name": "Get an audit log",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/audit-logs/{{audit_log_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "audit-logs",
                "{{audit_log_id}}"
              ]
            },
            "description": "Retrieves a single <Glossary>audit log</Glossary> entry by its guid."
          },
          "response": []
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Ensure a valid access token exists before any request in this folder.",
              "// Fetches one from POST {{baseUrl}}/oauth/auth_token only when missing or expired.",
              "",
              "function tokenExpired(token) {",
              "    try {",
              "        var payload = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');",
              "        while (payload.length % 4) { payload += '='; }",
              "        var decoded = JSON.parse(atob(payload));",
              "        if (!decoded.exp) { return false; }",
              "        // refresh 30s early to avoid edge-of-expiry failures",
              "        return (Date.now() / 1000) >= (decoded.exp - 30);",
              "    } catch (e) {",
              "        return true; // unparseable -> fetch a fresh one",
              "    }",
              "}",
              "",
              "var token = pm.collectionVariables.get('accessToken');",
              "if (token && !tokenExpired(token)) {",
              "    return; // existing token still good",
              "}",
              "",
              "var clientId = pm.collectionVariables.get('clientId');",
              "var clientSecret = pm.collectionVariables.get('clientSecret');",
              "var basic = CryptoJS.enc.Base64.stringify(",
              "    CryptoJS.enc.Utf8.parse(clientId + ':' + clientSecret)",
              ");",
              "",
              "pm.sendRequest({",
              "    url: pm.collectionVariables.get('baseUrl') + '/oauth/auth_token',",
              "    method: 'POST',",
              "    header: {",
              "        'Authorization': 'Basic ' + basic,",
              "        'Content-Type': 'application/x-www-form-urlencoded'",
              "    },",
              "    body: {",
              "        mode: 'urlencoded',",
              "        urlencoded: [",
              "            { key: 'grant_type', value: 'authorization_code' },",
              "            { key: 'code', value: pm.collectionVariables.get('authCode') }",
              "        ]",
              "    }",
              "}, function (err, res) {",
              "    if (err) {",
              "        console.log('[eVault] token request failed:', err);",
              "        return;",
              "    }",
              "    if (res.code !== 200) {",
              "        console.log('[eVault] token request returned', res.code, res.text());",
              "        return;",
              "    }",
              "    try {",
              "        var json = res.json();",
              "        if (json.access_token) { pm.collectionVariables.set('accessToken', json.access_token); }",
              "        if (json.refresh_token) { pm.collectionVariables.set('refreshToken', json.refresh_token); }",
              "    } catch (e) {",
              "        console.log('[eVault] could not parse token response:', e);",
              "    }",
              "});"
            ]
          }
        }
      ]
    },
    {
      "name": "Transactions",
      "item": [
        {
          "name": "Get a transaction",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/transactions/{{transaction_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "transactions",
                "{{transaction_id}}"
              ]
            },
            "description": "Retrieves a previously submitted transaction by its transaction guid, including its current status and details."
          },
          "response": []
        },
        {
          "name": "Updates an existing transaction",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/transactions/{{transaction_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "transactions",
                "{{transaction_id}}"
              ]
            },
            "description": "Confirms or updates a pending transaction — for example accepting or rejecting a pending <Glossary>transfer</Glossary> awaiting confirmation. The confirmation type is specified in the request body.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"confirmationType\": \"Accept\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Performs an inquiry",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/inquiry",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "inquiry"
              ]
            },
            "description": "Looks up the current registry state of an <Glossary>eNote</Glossary> by its <Glossary>MIN</Glossary> or eNote guid, returning status or summary information.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"min\": 123456789012345680,\n  \"enote_guid\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Performs a connectivity test",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/connectivity",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "connectivity"
              ]
            },
            "description": "Verifies connectivity to <Glossary>MERS eRegistry</Glossary> or <Glossary>MERS eDelivery</Glossary> for the given environment. The target is set by the address type in the request body.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"addressType\": \"eRegistry\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Performs a Registration",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/register",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "register"
              ]
            },
            "description": "Registers a newly created <Glossary>eNote</Glossary> on <Glossary>MERS eRegistry</Glossary>, establishing the initial <Glossary>controller</Glossary> and the <Glossary>location</Glossary> that maintains its <Glossary>authoritative copy</Glossary>. On success the eNote's <Glossary>electronic record</Glossary> is created with a status of Active.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"controllerOrgId\": 1234567,\n  \"locationOrgId\": 1234567,\n  \"servicerOrgId\": 1234567,\n  \"delegateeToTransferOrgId\": 1234567,\n  \"securedPartyOrgId\": 1234567,\n  \"securedPartyDelegateeOrgId\": 1234567,\n  \"transferControl\": false,\n  \"borrowers\": [\n    {\n      \"firstName\": \"First\",\n      \"middleName\": \"Middle\",\n      \"lastName\": \"Last\",\n      \"suffix\": \"Sr\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Performs a Change Status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/change-status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "change-status"
              ]
            },
            "description": "Changes the lifecycle status of a registered <Glossary>eNote</Glossary>'s <Glossary>electronic record</Glossary> — for example marking it paid off, charged off, <Glossary>converted to paper</Glossary>, or <Glossary>paper replacement</Glossary>, or reversing a prior status change. The status type is specified in the request body.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"REV_REGISTRATION\",\n  \"docGuid\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Performs a Change Data",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/change-data",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "change-data"
              ]
            },
            "description": "Updates data or party associations on a registered <Glossary>eNote</Glossary>'s <Glossary>electronic record</Glossary> without a full transfer — for example adding or releasing a <Glossary>secured party</Glossary>, changing the <Glossary>master servicer</Glossary> or <Glossary>subservicer</Glossary>, or reporting a modification or assumption. The change type is specified in the request body.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"ADD_DOCUMENT\",\n  \"documentType\": \"AppraisalReport\",\n  \"documentData\": \"iVBORw0KGgoAAAANSUhEUgAAAWIAAAFiCAYAAADMXNJ6AAADx0lEQVR42u3UQQ0AAAgDMeZfNOCChLRzsMelegfAmQgxgBADCLEbAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGAAhBhBiAIQYQIgBEGIAIQZAiAGEGECIhRhAiAGEGA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",\n  \"documentName\": \"Document 1\",\n  \"contentType\": \"application/pdf\",\n  \"borrowers\": [\n    {\n      \"firstName\": \"First\",\n      \"middleName\": \"Middle\",\n      \"lastName\": \"Last\",\n      \"suffix\": \"Sr\"\n    }\n  ],\n  \"modificationType\": \"Electronic\",\n  \"locationOrgId\": 1234567,\n  \"masterServicerOrgId\": 1234567,\n  \"subServicerOrgId\": 1234567,\n  \"transferDelegateeOrgId\": 1234567,\n  \"securedPartyOrgId\": 1234567,\n  \"securedPartyDelegateeOrgId\": 1234567\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Performs a Delivery",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/deliver",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "deliver"
              ]
            },
            "description": "Delivers the <Glossary>eNote</Glossary> to one or more recipient organizations via <Glossary>MERS eDelivery</Glossary>. Each recipient is identified by its <Glossary>MERS Org ID</Glossary> and may accept or reject the delivery.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"recipients\": [\n    \"1234567\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Performs a Transfer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/{{environment}}/enotes/{{enote_id}}/transfer",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "{{environment}}",
                "enotes",
                "{{enote_id}}",
                "transfer"
              ]
            },
            "description": "Changes the parties on a registered <Glossary>eNote</Glossary> — for example the <Glossary>controller</Glossary>, <Glossary>location</Glossary>, or <Glossary>secured party</Glossary>. The transfer type included in the request body determines which parties change.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"TransferAll\",\n  \"effectiveDate\": \"2019-02-28\",\n  \"controllerOrgId\": 1234567,\n  \"locationOrgId\": 1234567,\n  \"servicerOrgId\": 1234567,\n  \"subservicerOrgId\": 1234567,\n  \"securedPartyOrgId\": 1234567,\n  \"securedPartyDelegateeOrgId\": 1234567,\n  \"delegateeForTransferOrgId\": 1234567,\n  \"counterPartyOrgId\": 1234567,\n  \"includeDelivery\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Ensure a valid access token exists before any request in this folder.",
              "// Fetches one from POST {{baseUrl}}/oauth/auth_token only when missing or expired.",
              "",
              "function tokenExpired(token) {",
              "    try {",
              "        var payload = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');",
              "        while (payload.length % 4) { payload += '='; }",
              "        var decoded = JSON.parse(atob(payload));",
              "        if (!decoded.exp) { return false; }",
              "        // refresh 30s early to avoid edge-of-expiry failures",
              "        return (Date.now() / 1000) >= (decoded.exp - 30);",
              "    } catch (e) {",
              "        return true; // unparseable -> fetch a fresh one",
              "    }",
              "}",
              "",
              "var token = pm.collectionVariables.get('accessToken');",
              "if (token && !tokenExpired(token)) {",
              "    return; // existing token still good",
              "}",
              "",
              "var clientId = pm.collectionVariables.get('clientId');",
              "var clientSecret = pm.collectionVariables.get('clientSecret');",
              "var basic = CryptoJS.enc.Base64.stringify(",
              "    CryptoJS.enc.Utf8.parse(clientId + ':' + clientSecret)",
              ");",
              "",
              "pm.sendRequest({",
              "    url: pm.collectionVariables.get('baseUrl') + '/oauth/auth_token',",
              "    method: 'POST',",
              "    header: {",
              "        'Authorization': 'Basic ' + basic,",
              "        'Content-Type': 'application/x-www-form-urlencoded'",
              "    },",
              "    body: {",
              "        mode: 'urlencoded',",
              "        urlencoded: [",
              "            { key: 'grant_type', value: 'authorization_code' },",
              "            { key: 'code', value: pm.collectionVariables.get('authCode') }",
              "        ]",
              "    }",
              "}, function (err, res) {",
              "    if (err) {",
              "        console.log('[eVault] token request failed:', err);",
              "        return;",
              "    }",
              "    if (res.code !== 200) {",
              "        console.log('[eVault] token request returned', res.code, res.text());",
              "        return;",
              "    }",
              "    try {",
              "        var json = res.json();",
              "        if (json.access_token) { pm.collectionVariables.set('accessToken', json.access_token); }",
              "        if (json.refresh_token) { pm.collectionVariables.set('refreshToken', json.refresh_token); }",
              "    } catch (e) {",
              "        console.log('[eVault] could not parse token response:', e);",
              "    }",
              "});"
            ]
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Create a webhook configuration",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "webhooks"
              ]
            },
            "description": "Creates a <Glossary>webhook</Glossary> — a URL eVault calls when subscribed <Glossary>webhook event</Glossary>s fire — with its <Glossary>signing key</Glossary> and the set of events it subscribes to.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"My integration webhook\",\n  \"url\": \"https://example.com/webhooks/evault\",\n  \"signingKey\": \"s3cr3t-signing-key\",\n  \"sendEmailOnError\": false,\n  \"isTest\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Get a webhook configuration",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/webhooks/{{webhook_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "Retrieves a <Glossary>webhook</Glossary> configuration, including the <Glossary>webhook event</Glossary>s it subscribes to."
          },
          "response": []
        },
        {
          "name": "Edit a webhook configuration",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/webhooks/{{webhook_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "Updates an existing <Glossary>webhook</Glossary> configuration's name, URL, <Glossary>signing key</Glossary>, enabled state, or subscribed events.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"My integration webhook\",\n  \"url\": \"https://example.com/webhooks/evault\",\n  \"enabled\": true,\n  \"signingKey\": \"s3cr3t-signing-key\",\n  \"sendEmailOnError\": false,\n  \"events\": [\n    {\n      \"name\": \"Electronic records\",\n      \"settings\": [\n        {\n          \"key\": \"upload_document\",\n          \"display_name\": \"Upload document\",\n          \"value\": false,\n          \"children\": []\n        }\n      ]\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a webhook configuration",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/webhooks/{{webhook_id}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "webhooks",
                "{{webhook_id}}"
              ]
            },
            "description": "Deletes a <Glossary>webhook</Glossary> configuration."
          },
          "response": []
        },
        {
          "name": "Update a webhook configuration's active status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/webhooks/{{webhook_id}}/active-status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "webhooks",
                "{{webhook_id}}",
                "active-status"
              ]
            },
            "description": "Enables or disables a <Glossary>webhook</Glossary> configuration.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Test a webhook configuration",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/webhooks/{{webhook_id}}/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "webhooks",
                "{{webhook_id}}",
                "test"
              ]
            },
            "description": "Sends a test event to a <Glossary>webhook</Glossary>'s configured URL and reports whether delivery succeeded."
          },
          "response": []
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "// Ensure a valid access token exists before any request in this folder.",
              "// Fetches one from POST {{baseUrl}}/oauth/auth_token only when missing or expired.",
              "",
              "function tokenExpired(token) {",
              "    try {",
              "        var payload = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');",
              "        while (payload.length % 4) { payload += '='; }",
              "        var decoded = JSON.parse(atob(payload));",
              "        if (!decoded.exp) { return false; }",
              "        // refresh 30s early to avoid edge-of-expiry failures",
              "        return (Date.now() / 1000) >= (decoded.exp - 30);",
              "    } catch (e) {",
              "        return true; // unparseable -> fetch a fresh one",
              "    }",
              "}",
              "",
              "var token = pm.collectionVariables.get('accessToken');",
              "if (token && !tokenExpired(token)) {",
              "    return; // existing token still good",
              "}",
              "",
              "var clientId = pm.collectionVariables.get('clientId');",
              "var clientSecret = pm.collectionVariables.get('clientSecret');",
              "var basic = CryptoJS.enc.Base64.stringify(",
              "    CryptoJS.enc.Utf8.parse(clientId + ':' + clientSecret)",
              ");",
              "",
              "pm.sendRequest({",
              "    url: pm.collectionVariables.get('baseUrl') + '/oauth/auth_token',",
              "    method: 'POST',",
              "    header: {",
              "        'Authorization': 'Basic ' + basic,",
              "        'Content-Type': 'application/x-www-form-urlencoded'",
              "    },",
              "    body: {",
              "        mode: 'urlencoded',",
              "        urlencoded: [",
              "            { key: 'grant_type', value: 'authorization_code' },",
              "            { key: 'code', value: pm.collectionVariables.get('authCode') }",
              "        ]",
              "    }",
              "}, function (err, res) {",
              "    if (err) {",
              "        console.log('[eVault] token request failed:', err);",
              "        return;",
              "    }",
              "    if (res.code !== 200) {",
              "        console.log('[eVault] token request returned', res.code, res.text());",
              "        return;",
              "    }",
              "    try {",
              "        var json = res.json();",
              "        if (json.access_token) { pm.collectionVariables.set('accessToken', json.access_token); }",
              "        if (json.refresh_token) { pm.collectionVariables.set('refreshToken', json.refresh_token); }",
              "    } catch (e) {",
              "        console.log('[eVault] could not parse token response:', e);",
              "    }",
              "});"
            ]
          }
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://evault.ncino.com",
      "type": "string"
    },
    {
      "key": "clientId",
      "value": "",
      "type": "string"
    },
    {
      "key": "clientSecret",
      "value": "",
      "type": "string"
    },
    {
      "key": "authCode",
      "value": "",
      "type": "string"
    },
    {
      "key": "accessToken",
      "value": "",
      "type": "string"
    },
    {
      "key": "refreshToken",
      "value": "",
      "type": "string"
    },
    {
      "key": "environment",
      "value": "stage",
      "type": "string"
    },
    {
      "key": "enote_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "transaction_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "audit_log_id",
      "value": "",
      "type": "string"
    }
  ]
}
