# Delete ALL Custom Objects with 1 call

**URL:** <https://community.hubspot.com/t/delete-all-custom-objects-with-1-call/80934>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [May 10, 2023, 3:09pm UTC](https://community.hubspot.com/t/delete-all-custom-objects-with-1-call/80934 "2023-05-10T15:09:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreMiranda](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/andremiranda/32/85896_2.png) [@AndreMiranda](https://community.hubspot.com/u/AndreMiranda)\
**Post date:** [May 10, 2023, 3:09pm UTC](https://community.hubspot.com/t/delete-all-custom-objects-with-1-call/80934/1 "2023-05-10T15:09:28Z")

</div>

Hi!

I want delete all Custom Objects in a single api call, because I need to insert data after. So, it would be easier do delete everything and the re/insert new data.

Checking documentation I found this POST url /crm/v3/objects/{objectType}/batch/archive that could potentially do what I need. However, this endpoint requires an ID on its body.

I also saw this thread [https://community.hubspot.com/t5/APIs-Integrations/Delete-all-the-Custom-Object-records-in-single-shot/td-p/686055](https://community.hubspot.com/t5/APIs-Integrations/Delete-all-the-Custom-Object-records-in-single-shot/td-p/686055) which one needed the same thing as I do and the suggestion was to use the same endpoint.

However it doesn’t make sense to me… If I will need the Object ID, then first I will need to select the Custom Object record, get its ID and then use it in the batch archive endpoint… it doesn’t seem a delete all call for me. It seems a delete one by one call actually and then I will have to call the endpoint many times.

What am I missing her?  
Thanks!

---

<div class="post-metadata">

**Author:** ![JBeatty](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jbeatty/32/52252_2.png) [@JBeatty](https://community.hubspot.com/u/JBeatty)\
**Post date:** [May 10, 2023, 6:26pm UTC](https://community.hubspot.com/t/delete-all-custom-objects-with-1-call/80934/2 "2023-05-10T18:26:58Z")

</div>

Hi @AndreMiranda,

To my knowledge there is no way to delete all custom objects in a single call. The best I can think of would be to delete them in batches of 100 at a time with 2 API calls per batch.

First start with the List endpoint “GET /crm/v3/objects/{objectType}” with a limit of 100 to get 100 object IDs. Then use the batch delete “POST /crm/v3/objects/{objectType}/batch/archive” to delete those 100 objects. Then repeat this until the objects are all deleted.

The docs for those endpoints can be found here: [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/crm-custom-objects)

Best,

---

<div class="post-metadata">

**Author:** ![AndreMiranda](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/andremiranda/32/85896_2.png) [@AndreMiranda](https://community.hubspot.com/u/AndreMiranda)\
**Post date:** [May 11, 2023, 8:21am UTC](https://community.hubspot.com/t/delete-all-custom-objects-with-1-call/80934/3 "2023-05-11T08:21:39Z")

</div>

Hi @JBeatty ,  
Yeah, I even started doing just like the way you described… getting and deleting after. I’ll do that!

Many thanks!
