Skip to main content

Syncing Loan Changes Through the API

Use the loan change feed to find out which loans changed and keep your own database current.

H
Written by Hannah Levick

The loan change feed tells your system which loans changed since it last asked. Use it to keep a reporting database or data warehouse current without re-reading every loan.

Before you start

  • You need an API key with View on Data, under Loans. See Generating and Managing API Keys.

  • The key must be able to reach every loan. A company-level key does. A key assigned to a user does only if that user can view every user's loans, listed as "View loan files (all users)" in the User Roles & Permissions chart. By default, that is an Admin, Agent, Processor, Underwriter or Support user. A key assigned to an Originator is refused.


Getting the changes

Send the key in the x-api-key header. On the first call, send start, the date and time to read changes from:

GET https://<your-sonar-host>/api/v1/loans/changes?start=2026-12-01T00:00:00Z
x-api-key: YOUR_API_KEY

Two endpoints share the same parameters and paging:

  • /api/v1/loans/changes returns each changed loan and the sections that changed, such as borrowers or fees.

  • /api/v1/loans/changes/batch returns the same rows, each with the loan's current data for those sections.

A response looks like this:

{
  "rows": [
    {
      "loanId": "48213",
      "action": "Updated",
      "archiveStatus": "None",
      "changedAt": "2026-12-01T14:02:11Z",
      "full": false,
      "sections": ["borrowers", "fees"]
    }
  ],
  "count": 1,
  "nextCursor": "eyJ2IjoxLCJjIjo...",
  "hasMore": false
}

How the cursor works

  1. Every response includes nextCursor. Send it back as cursor on your next call, without start.

  2. While hasMore is true, call again right away.

  3. When hasMore is false, you are caught up. Keep that nextCursor and send it on your next scheduled run. You get only what changed since.

Save the cursor only after your own write succeeds. Cursors do not expire.

Reading a row

  • One row per loan. A loan appears once per pass, at its latest change. The same loan can arrive again later, so match on loanId.

  • action is Added, Updated or Deleted.

  • full. When true, treat the whole loan as changed. Added loans are always full.

  • Batch data replaces. Each section in a batch row is the loan's complete current list. Replace your stored copy with it.

  • Social Security numbers are masked. Batch data shows only the last 4 digits unless the key has View Full SSN.

Limits

  • limit sets the page size: up to 500 rows (default 100), or up to 50 on the batch endpoint (default 20).

  • Your company can make 60 requests per minute.

Every parameter and response field is in the Sonar API reference.


FAQs

What do 403, 404 and 429 mean?

  • 403: the key doesn't have View on Data, or its user can't see every loan. 404: the change feed is not turned on for your company. 429: you passed the rate limit. Wait for the time in the Retry-After header.

Will loans that haven't changed show up?

  • No. Sonar records loan changes from the day the change feed is turned on for your company. A loan appears in the feed once it changes after that.

Questions? Contact us at [email protected].

Did this answer your question?