Is there an API endpoint for recently edited posts

Is there a way to use the API to view the posts that were recently updated? For example the latest posts endpoint 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

1 Like

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 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.

2 Likes

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?

2 Likes

Yes, if the Data Explorer 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 queries via the API if you like: Run Data Explorer queries with the Discourse API.

3 Likes

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