# Fetch most recently added or modified custom object records

**URL:** <https://community.hubspot.com/t/fetch-most-recently-added-or-modified-custom-object-records/27890>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [November 11, 2020, 8:29pm UTC](https://community.hubspot.com/t/fetch-most-recently-added-or-modified-custom-object-records/27890 "2020-11-11T20:29:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![APIANT](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/apiant/32/227387_2.png) [@APIANT](https://community.hubspot.com/u/APIANT)\
**Post date:** [November 11, 2020, 8:29pm UTC](https://community.hubspot.com/t/fetch-most-recently-added-or-modified-custom-object-records/27890/1 "2020-11-11T20:29:03Z")

</div>

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.

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fcrm-custom-objects-v3%2Fguide)**

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?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [November 12, 2020, 8:59pm UTC](https://community.hubspot.com/t/fetch-most-recently-added-or-modified-custom-object-records/27890/2 "2020-11-12T20:59:04Z")

</div>

Hey @APIANT

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

```lia-code-sample
{
 "sorts": [{
 "propertyName":"hs_lastmodifieddate",
 "direction": "DESCENDING"
 }
 ],
 "limit": 10,
 "after": 0
}

```

More details on search can be found [here](https://developers.hubspot.com/docs/api/crm/search?_ga=2.56351019.1059212467.1604502924-1273358196.1598626193)

---

<div class="post-metadata">

**Author:** ![APIANT](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/apiant/32/227387_2.png) [@APIANT](https://community.hubspot.com/u/APIANT)\
**Post date:** [November 12, 2020, 9:01pm UTC](https://community.hubspot.com/t/fetch-most-recently-added-or-modified-custom-object-records/27890/3 "2020-11-12T21:01:13Z")

</div>

Excellent, thanks for the info!!
