# Webhooks: how best to differentiate a PM from a public post

**URL:** <https://meta.discourse.org/t/webhooks-how-best-to-differentiate-a-pm-from-a-public-post/76363>\
**Category:** Development\
**Tags:** webhooks\
**Created:** [2017 年 12 月 18 日午後 11:52 UTC](https://meta.discourse.org/t/webhooks-how-best-to-differentiate-a-pm-from-a-public-post/76363 "2017-12-18T23:52:31Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![johnaschroeder](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johnaschroeder/32/84460_2.png) [@johnaschroeder](https://meta.discourse.org/u/johnaschroeder)\
**Post date:** [2017 年 12 月 19 日午後 2:08 UTC](https://meta.discourse.org/t/webhooks-how-best-to-differentiate-a-pm-from-a-public-post/76363/9 "2017-12-19T14:08:27Z")

</div>

@tgxworld Based on Simon’s reply, is the best way to differentiate a PM to make a request back to the API at “topics/get a single topic by id” and pass the ID for every post? Then if the archetype comes back private\_message we’ll filter it out, if it comes back “regular” we’ll use it. We seem to get either a post created with post\_number = 1 or a topic\_created with no post\_created. We’ll check for both and that should cover our use cases.

Is there any documentation on the JSON fields, possible values, and meaning for topics, posts, and users? For example, are there other possible values for archetype? What does actions\_summary signify with id=n? Alternatively, if you could point us to somewhere in the code base that builds the JSON objects passed in the webhooks that would be something. We poked around but couldn’t find the data itself, just the events and objects passed.

---

_[View the full topic](https://meta.discourse.org/t/webhooks-how-best-to-differentiate-a-pm-from-a-public-post/76363)._
