# How do I find deleted posts via API?

**URL:** <https://meta.discourse.org/t/how-do-i-find-deleted-posts-via-api/197200>\
**Category:** Product Support\
**Created:** [July 15, 2021, 5:12am UTC](https://meta.discourse.org/t/how-do-i-find-deleted-posts-via-api/197200 "2021-07-15T05:12:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [July 19, 2021, 8:32pm UTC](https://meta.discourse.org/t/how-do-i-find-deleted-posts-via-api/197200/4 "2021-07-19T20:32:12Z")

</div>

> [@BenKrauth](#):
>
> I use the API to store posts in my database so I don’t have to call the API every time I want to display data for every user.

This is a great approach!

> [@BenKrauth](#):
>
> But since there’s apparently no way to find out when posts are deleted, I end up showing some deleted posts and people don’t understand why the links aren’t working right.

I think that pointing a Post Event webhook to your application would work for this. When a post is deleted, the webhook’s `X-Discourse-Event` will be set to `post_destroyed`. You could save the post ids for destroyed posts on your application and exclude those posts when displaying Discourse content on your site.

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-find-deleted-posts-via-api/197200)._
