# Question about batch read API

**URL:** <https://community.hubspot.com/t/question-about-batch-read-api/124594>\
**Category:** APIs & Integrations\
**Tags:** starter\
**Created:** [January 23, 2025, 2:37am UTC](https://community.hubspot.com/t/question-about-batch-read-api/124594 "2025-01-23T02:37:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LZhao](https://avatars.discourse-cdn.com/v4/letter/l/67e7ee/32.png) [@LZhao](https://community.hubspot.com/u/LZhao)\
**Post date:** [January 23, 2025, 2:37am UTC](https://community.hubspot.com/t/question-about-batch-read-api/124594/1 "2025-01-23T02:37:16Z")

</div>

Hi,  
I am using the /crm/v3/objects/$objType/batch/read POST API to detect deleted or merged objects on HubSpot, but I have a few questions about its behavior to ensure I use it correctly and avoid unintended deletions in my system.  
Scenario 1: Deleted Objects  
When an object is deleted on HubSpot, the API returns the following response:  
{  
“results”: [],  
“errors”: [  
{  
“status”: “error”,  
“category”: “OBJECT\_NOT\_FOUND”,  
“message”: “Could not get some COMPANY objects, they may be deleted or not exist. Check that ids are valid.”,  
“context”: {  
“ids”: [  
“8380080352”,  
“8144745976”,  
“7440157923”  
]  
}  
}  
]  
}  
In this case, if category is OBJECT\_NOT\_FOUND, I can extract the ids from the errors.context.ids array and handle them as deleted objects in my system.

Scenario 2: Merged Objects  
Sometimes, contacts in HubSpot are merged. In such cases, the API can return the following response:  
{  
“results”: [  
{  
“id”: “84805801”,  
“properties”: {  
“email”: “[mary.miller@usfoods.com](mailto:mary.miller@usfoods.com)”,  
“createdate”: “2020-03-03T20:18:42.589Z”,  
“firstname”: “Mary”,  
“hs\_object\_id”: “84805801”,  
“lastname”: “Miller”,  
“lastmodifieddate”: “2024-08-10T23:13:12.293Z”  
},  
“createdAt”: “2020-03-03T20:18:42.589Z”,  
“updatedAt”: “2024-08-10T23:13:12.293Z”  
}  
]  
}  
Here, the id in the response (84805801) is different from the id in my original request (62241). This indicates that the contact was merged. In such cases, I also need to remove this record (62241) from my system.

Questions:  
1. Are there other scenarios I should consider to avoid mistakenly deleting or overwriting data in my system?  
2. For merged objects, is it safe to assume that if the id in the response differs from the id in my request, the object has been merged, and the new ID should be used?  
3. Is there a recommended approach to handle errors and results together to ensure I don’t miss any edge cases?  
Any insights or recommendations for using this API correctly would be greatly appreciated, thanks

---

<div class="post-metadata">

**Author:** ![Bortami](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bortami/32/221350_2.png) [@Bortami](https://community.hubspot.com/u/Bortami)\
**Post date:** [January 24, 2025, 4:57pm UTC](https://community.hubspot.com/t/question-about-batch-read-api/124594/2 "2025-01-24T16:57:35Z")

</div>

You can also verify that the records were truly deleted and not an error by passing `archived=true` in the url.

The new Id returned is the new merged record id. All previous records that were merged into that record will be routed to that new id. One thing to watch out for is that it doesn’t tell you which companies were merged into it unless you specify the property `hs_merged_object_ids` and do comparison with it’s content.
