Fetch most recently added or modified custom object records

Hi,

We want to be able to fetch the most recently added or modified records for a custom object. This is very common functionality useful for building polling triggers, where newly added or modified records can be processed and sent to other systems.

The “list” endpoint doesn’t have any sorting. The “search” endpoint does have a sort parameter, but the documentation doesn’t say how to use it or how to control the direction of sorting.
Is there a way to fetch custom object records sorted by either most recently added or most recently updated? Or do custom objects provide webhooks?

Hey @APIANT

I just ran a quick test with the Search endpoint with this simple payload:

{
 "sorts": [{
 "propertyName":"hs_lastmodifieddate",
 "direction": "DESCENDING"
 }
 ],
 "limit": 10,
 "after": 0
}

More details on search can be found here

Excellent, thanks for the info!!