# 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:** [December 18, 2017, 11:52pm 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:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [December 19, 2017, 12:39am UTC](https://meta.discourse.org/t/webhooks-how-best-to-differentiate-a-pm-from-a-public-post/76363/2 "2017-12-19T00:39:30Z")

</div>

It’s messy, but if you setup both a Post and a Topic webhook. When a message, or topic is first created, both hooks will be fired. You can use the `topic_id` that is sent with the Post webhook to get the topic `archetype` from the topic webhook data. It will be set to ‘private\_message’ for messages, ‘regular’ for regular topics.

It would be great to get some topic data sent with the Post webhook - `category_id` and `archetype` would both be useful.

---

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