Contentful logo

Contentful Community

Querying for deleted entries


Hi all,

I’m trying to get batchSize of entries that have been updated since some time from. So far, the following works for most of my cases:

  public List<CMAEntry> fetchBatch(ZonedDateTime from, Integer batchSize) {

    Map<String, String> query = new HashMap<>();

    query.put("limit", batchSize.toString());
    return client.entries().fetchAll(query).getItems();

However, I’d also like this to include recently deleted entries. In my head, ‘deleting’ an entry is equivalent to ‘updating’ it to no longer exist. I’d love to know if there is a way I can modify this query so that recently deleted items are also included.

Does anyone have an idea? Does this make sense? I can expand more if required.




Hi @sam.warner,

A possibility here would be to instead use the Sync API to fetch content that was recently deleted in your space.

You can find more information about this in here:

Here’s an implementation in JavaScript: