# Is there an API endpoint for recently edited posts

**URL:** https://meta.discourse.org/t/is-there-an-api-endpoint-for-recently-edited-posts/252114
**Category:** Development
**Tags:** rest-api
**Created:** [January 18, 2023, 2:48am UTC](https://meta.discourse.org/t/is-there-an-api-endpoint-for-recently-edited-posts/252114 "2023-01-18T02:48:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![not-ethan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/not-ethan/32/282617_2.png) [@not-ethan](https://meta.discourse.org/u/not-ethan)
#### Post date: [January 18, 2023, 2:48am UTC](https://meta.discourse.org/t/is-there-an-api-endpoint-for-recently-edited-posts/252114/1 "2023-01-18T02:48:20Z")

</div>

Is there a way to use the API to view the posts that were recently updated? For example the [latest posts endpoint](https://docs.discourse.org/#tag/Posts/operation/listPosts) but I don’t see any for edits. I found an endpoint for recent edits under `moderation` on the dashboard but that is only edits not made by the poster but I want all edits including ones by the poster

---

<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: [January 23, 2023, 2:55am UTC](https://meta.discourse.org/t/is-there-an-api-endpoint-for-recently-edited-posts/252114/2 "2023-01-23T02:55:06Z")

</div>

> [@not-ethan](#):
>
> Is there a way to use the API to view the posts that were recently updated?

I don’t think so. The easiest way to think of the API is that there is an endpoint for everything that is displayed in the user interface. Unless you are finding a way to view recently edited posts in the UI, it’s unlikely there is an API endpoint for it.

Depending on your use case, you could setup a Post Event [webhook](https://meta.discourse.org/t/configure-webhooks-that-trigger-on-discourse-events-to-integrate-with-external-services/49045) to point to an external service. To find edited posts, check the webhook’s `X-Discourse-Event` header. Edited posts will have that header set to `post_edited`.

---

<div class="post-metadata">

### Author: ![not-ethan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/not-ethan/32/282617_2.png) [@not-ethan](https://meta.discourse.org/u/not-ethan)
#### Post date: [January 23, 2023, 2:56am UTC](https://meta.discourse.org/t/is-there-an-api-endpoint-for-recently-edited-posts/252114/3 "2023-01-23T02:56:31Z")

</div>

Thanks. Now that im thinking about this some more would it be possible to set up an SQL query to list recently edits posts and use that to do this?

---

<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: [January 23, 2023, 2:58am UTC](https://meta.discourse.org/t/is-there-an-api-endpoint-for-recently-edited-posts/252114/4 "2023-01-23T02:58:28Z")

</div>

Yes, if the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin is installed on your site, writing a query to return recently edited posts would be the easiest way of dealing with this. You can also call [Data Explorer](https://meta.discourse.org/t/32566?silent=true) queries via the API if you like: [Run Data Explorer queries with the Discourse API](https://meta.discourse.org/t/run-data-explorer-queries-with-the-discourse-api/120063).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [February 22, 2023, 2:59am UTC](https://meta.discourse.org/t/is-there-an-api-endpoint-for-recently-edited-posts/252114/5 "2023-02-22T02:59:23Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
