删除某用户在某分类中的所有消息

I don’t have personal experience of these, but I believe you can ‘soft’ delete using the API -

And there are a few topics on ‘hard’ deleting if you search for ‘rails delete post’.

If you can give a few more details about what you’re trying to achieve, people may have more specific tips.