APIs & Integrations

aemmi
Participant

Get for contacts updateafter is not working

SOLVE

I use the following get command

https://api.hubapi.com/crm/v3/objects/contacts?limit=100&updatedAfter=1747668849754

1747668849754  time stamp is Mon 19 May 2025
12:26:19

bu it's returning rows with a lastmodified date before that

aemmi_0-1747687228949.png

 

0 Upvotes
2 Accepted solutions
RubenBurdin
Solution
Top Contributor

Get for contacts updateafter is not working

SOLVE

Hi, @aemmi 

I feel the pain, pulling “recent” contacts and getting older ones back, let’s try figure why this happen.

1. First, HubSpot filters on the internal updatedAt timestamp, not on the property you might read as lastmodifieddate; if the record got a silent system touch (owner change, association add), updatedAt can be newer than the human-visible fields, so an older looking lastmodifieddate may still pass the updatedAfter gate (Scopious Digital).

2. Add two extra params so you see exactly what HubSpot is testing:
&properties=updatedAt&sort=updatedAt — this returns the API’s clock value and sorts the list; you’ll notice every contact in the payload has updatedAt > 1747668849754, even if other dates look earlier.

3. I’m infering you omitted archived=false; without it HubSpot can serve archived contacts that were deleted after your timestamp but originally modified long ago, which confuses the eye—try adding &archived=false just to be safe.

4. Can you confirm your timestamp really is milliseconds (13 digits)? Some teams accidentally send seconds (10 digits), HubSpot then thinks you asked for 1970… tiny detail but it break the filter.

5. If you truly need to compare on hs_lastmodifieddate instead of the backend flag, switch to the Search API and post a filter:

{"filterGroups":[{"filters":[{"propertyName":"hs_lastmodifieddate","operator":"GT","value":"1747668849754"}]}]}

Search respects any property you target, so visual dates and API dates will align.

6. Side note: the contacts/list endpoint pages by ID, not updatedAt; an early page may still include a few edge cases even when the filter is right. Cycle through all pages (follow the paging.after cursor) before judging the set.

7. Already a Community thread (API to Get recently updated contacts) reached the same conclusion—adding the sort param plus archived flag fixed the issue for them; worth a look if you want the long version.

Hope that’s useful.

Did my answer help? Please mark it as a solution to help others find it too.

Ruben Burdin Ruben Burdin
HubSpot Advisor
Founder @ Stacksync
Real-Time Data Sync between any CRM and Database
Stacksync Banner

View solution in original post

0 Upvotes
aemmi
Solution
Participant

Get for contacts updateafter is not working

SOLVE

I was able to gt the desired results using the search endpoint, https://api.hubapi.com/crm/v3/objects/contacts/search.  I had to use 

lastmodifieddate instead of hs_lastmodifieddate as it seems this value is null for all changed records.

View solution in original post

0 Upvotes
3 Replies 3
aemmi
Solution
Participant

Get for contacts updateafter is not working

SOLVE

I was able to gt the desired results using the search endpoint, https://api.hubapi.com/crm/v3/objects/contacts/search.  I had to use 

lastmodifieddate instead of hs_lastmodifieddate as it seems this value is null for all changed records.
0 Upvotes
RubenBurdin
Solution
Top Contributor

Get for contacts updateafter is not working

SOLVE

Hi, @aemmi 

I feel the pain, pulling “recent” contacts and getting older ones back, let’s try figure why this happen.

1. First, HubSpot filters on the internal updatedAt timestamp, not on the property you might read as lastmodifieddate; if the record got a silent system touch (owner change, association add), updatedAt can be newer than the human-visible fields, so an older looking lastmodifieddate may still pass the updatedAfter gate (Scopious Digital).

2. Add two extra params so you see exactly what HubSpot is testing:
&properties=updatedAt&sort=updatedAt — this returns the API’s clock value and sorts the list; you’ll notice every contact in the payload has updatedAt > 1747668849754, even if other dates look earlier.

3. I’m infering you omitted archived=false; without it HubSpot can serve archived contacts that were deleted after your timestamp but originally modified long ago, which confuses the eye—try adding &archived=false just to be safe.

4. Can you confirm your timestamp really is milliseconds (13 digits)? Some teams accidentally send seconds (10 digits), HubSpot then thinks you asked for 1970… tiny detail but it break the filter.

5. If you truly need to compare on hs_lastmodifieddate instead of the backend flag, switch to the Search API and post a filter:

{"filterGroups":[{"filters":[{"propertyName":"hs_lastmodifieddate","operator":"GT","value":"1747668849754"}]}]}

Search respects any property you target, so visual dates and API dates will align.

6. Side note: the contacts/list endpoint pages by ID, not updatedAt; an early page may still include a few edge cases even when the filter is right. Cycle through all pages (follow the paging.after cursor) before judging the set.

7. Already a Community thread (API to Get recently updated contacts) reached the same conclusion—adding the sort param plus archived flag fixed the issue for them; worth a look if you want the long version.

Hope that’s useful.

Did my answer help? Please mark it as a solution to help others find it too.

Ruben Burdin Ruben Burdin
HubSpot Advisor
Founder @ Stacksync
Real-Time Data Sync between any CRM and Database
Stacksync Banner
0 Upvotes
aemmi
Participant

Get for contacts updateafter is not working

SOLVE

Still not getting the desired resuts,  Even adding the suggestions it still returns the sames results.  The hs_lastmodifieddate is null, could that be the issue.  is there a different endpoint for the search API to add a filter 

This is the latestes endpoint I used https://api.hubapi.com/crm/v3/objects/contacts?archived=false&updatedAfter=1747649415695&limit=100&s...

aemmi_0-1747751836871.png

 

0 Upvotes