Making a difference between public topic and private message on API

You’ll need to look at the topic that the post belongs to. There is a field there that tells you if it is a pm.