# How to list archived objects sorted by a field?

**URL:** <https://community.hubspot.com/t/how-to-list-archived-objects-sorted-by-a-field/35004>\
**Category:** APIs & Integrations\
**Tags:** companies, object, contacts\
**Created:** [April 6, 2021, 1:47pm UTC](https://community.hubspot.com/t/how-to-list-archived-objects-sorted-by-a-field/35004 "2021-04-06T13:47:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![digows](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/digows/32/99782_2.png) [@digows](https://community.hubspot.com/u/digows)\
**Post date:** [April 6, 2021, 1:47pm UTC](https://community.hubspot.com/t/how-to-list-archived-objects-sorted-by-a-field/35004/1 "2021-04-06T13:47:14Z")

</div>

Hi,

I need to know which objects were deleted after a specific date.

Since the Search API and the old Recent Changes API don’t allow return deleted data,

I need to list **archived** companies/contacts/deals/engagements **sorted by** archivedAt to keep consistency.  
How to do it?

---

<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:** [April 7, 2021, 1:29pm UTC](https://community.hubspot.com/t/how-to-list-archived-objects-sorted-by-a-field/35004/2 "2021-04-07T13:29:56Z")

</div>

Hey @digows

I think you would need to do a get for the object and change the archived param to true. Then your application would digest and sort as needed.

@RMones , does this seem like an appropriate way of handling this?

---

<div class="post-metadata">

**Author:** ![digows](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/digows/32/99782_2.png) [@digows](https://community.hubspot.com/u/digows)\
**Post date:** [April 7, 2021, 1:51pm UTC](https://community.hubspot.com/t/how-to-list-archived-objects-sorted-by-a-field/35004/3 "2021-04-07T13:51:21Z")

</div>

Hi @dennisedson.

Thanks for your reply, but this doesn’t fit my need, since I have 500+ Hubspot customers and I need to sync deletion of any object type.

I’ve already discussed this with someone from Hubspot and there is no way to it for now.

The solution is to use a combination of Webhook subscriptions, API calls and rebuild the cached data from time to time.

I already opened a request to allow sorting in the List API calls too, which would make things much easier for both sides.

---

<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:** [April 7, 2021, 2:14pm UTC](https://community.hubspot.com/t/how-to-list-archived-objects-sorted-by-a-field/35004/4 "2021-04-07T14:14:25Z")

</div>

oofta,

Yeah, I was imagining only one portal you were working on. 500+ definitely changes things…

Where did you open this request? In the ideas board?
