How to Query the Group Messages

Hi Discourse team,

We’re trying to find a way to query all messages within a specific group. Looking into the database tables, there are no tables for messages. I’m assuming that messages are just topics that are private to a specific group, is that correct? If so, how do we query that?

Thanks!

Does it need to be a query, or would using the Search be enough? (eg using the search filters group_messages:GROUPNAME or group:GROUPNAME)

To answer the question though; both regular and personal message topics are in the topics table and have an ‘archetype’ you can query against. :+1: (with all posts being in the posts table)

2 Likes

Thanks for your response @JammyDodger , I’ll try it and let you know how I go!

1 Like