Delete by Query - Is there a way to get the ids of the deleted documents?

I don't think you can.

But you can manually reproduce what elasticsearch is doing behind the scene on the client side.

Do a scroll search and bulk the delete operations.