HS SDK contact search working, update returns Object not found
Hi,
I am using the HS SDK (Node.js) to create and update contacts. In the recent few weeks, I encountered an interesting error that occurs sometimes (let's say a few hundred times per thousand). The contacts were created in HS sometimes a few minutes before, but in many cases, the contact exists on the HS side for months.
The code makes a call for the user, via the `
crm.contacts.searchApi.doSearch
` request, searching for a contact by email. The response is clear, the contact does indeed exist:
And logged into HS and searched in the contacts as well to show the contact. Everything is present, fine as-is.
After the search request is done, within 1 second, the implementation does another request to update the contact (by email address)
'crm.contacts.basicApi.update',
But for this, it got an error response
{\\"total\\":1,\\"results\\":[{\\"createdAt\\":\\"2025-09-12T11:03:52.204Z\\",\\"archived\\":false,\\"id\\":\\"[REDACTED]817\\",\\"properties\\":{\\"createdate\\":\\"2025-09-12T11:03:52.204Z\\",\\"email\\":\\"john.doe@gmail.com\\",\\"firstname\\":\\"John\\",\\"hs_object_id\\":\\"[REDACTED]817\\",\\"lastmodifieddate\\":\\"2025-09-23T17:45:43.067Z\\",\\"lastname\\":\\"Doe\\"},\\"updatedAt\\":\\"2025-09-23T17:45:43.067Z\\"}]}",{"code":404,"body":{"status":"error","message":"Object not found. objectId are usually numeric.","correlationId":"[REDACTED]","context":{"id":["john.doe%40gmail.com?idProperty=email"]},"category":"OBJECT_NOT_FOUND"},"headers":{"access-control-allow-credentials":"false","cf-cache-status":"DYNAMIC","cf-ray":"[REDACTED]","connection":"keep-alive","content-encoding":"gzip","content-type":"application/json;charset=utf-8","date":"Tue, 23 Sep 2025 18:06:50 GMT","nel":"{\\"success_fraction\\":0.01,\\"report_to\\":\\"cf-nel\\",\\"max_age\\":604800}","report-to":"{\\"endpoints\\":[{\\"url\\":\\"https:\\\\/\\\\/a.nel.cloudflare.com\\\\/report\\\\/v4?s=[REDACTED]\\"}],\\"group\\":\\"cf-nel\\",\\"max_age\\":604800}","server":"cloudflare","set-cookie":"__cf_bm=[REDACTED]; path=/; expires=Tue, 23-Sep-25 18:36:50 GMT; domain=.hubapi.com; HttpOnly; Secure; SameSite=None","strict-transport-security":"max-age=31536000; includeSubDomains; preload","transfer-encoding":"chunked","vary":"origin, Accept-Encoding","x-hubspot-correlation-id":"[REDACTED]","x-hubspot-notfound":"true","x-hubspot-ratelimit-interval-milliseconds":"10000","x-hubspot-ratelimit-max":"110","x-hubspot-ratelimit-remaining":"105","x-hubspot-ratelimit-secondly":"11","x-hubspot-ratelimit-secondly-remaining":"10"}}
The SDK version is `
@hubspot/api-client": "^11.0.0"
The code was used in the previous 6 months with literal millions of contacts, and this error did not occur.
The first time it was seen on the 22nd of August, 2025, then a few times in the first week of September, and since ~25th of September, the percentage has gone up from less than 1% to 5%.
Comparing different contacts, there is no difference in the data set nor in timing, how much time spans between a creation, search, and update.
Also, all the failure has the same message, the same structure, and no differences present.
"As I see, you are doing everything correctly. The only thing that comes to mind is maybe the latter part of your code is executed before the previous one. You can use async await to wait till the ID is fetched so that the code runs synchronously. If the problem still persists, then please contact HubSpot contact as they can guide you best in this case.
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
HS SDK contact search working, update returns Object not found
Thank you for the idea, unfortunately, no. By timestamps and by the code itself, it is serialized, and the update waits for the response from the search. Also, as I mentioned, the contact was created in a few cases weeks before the code run, so asynchronicity could not affect it.
I haven't seen this error before therefore, I'd like to tag in some of our Top Contributors to see if they have received this error before.
Hi @Mike_Eastwood@ChristinaKay and @mangelet I hope you all are having a great pre-Friday! Have any of you seen this behavior before? If so, how did you resolve?
Thank you!
Cassie, Community Manager
Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
I understand that you are experiencing an issue with the HubSpot Node.js SDK where, despite successfully finding a contact by email through a search API call, an immediate attempt to update that contact sometimes returns a 404 "Object not found" error, even though the contact exists and the code previously worked.
I'd like to tag in some of our Top Contributors to see if they have seen this before -- Hi @miljkovicmisa@stefen and @Teun Have any of you all experienced this type of behavior before? If so, how did you go about handling it?
Thank you!
Cassie, Community Manager
Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.