# Webhook event \`post\_type\`

**URL:** https://meta.discourse.org/t/webhook-event-post-type/249088
**Category:** Support
**Created:** [December 16, 2022, 1:18am UTC](https://meta.discourse.org/t/webhook-event-post-type/249088 "2022-12-16T01:18:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Lucas\_Alves](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucas_alves/32/285677_2.png) [@Lucas\_Alves](https://meta.discourse.org/u/Lucas_Alves)
#### Post date: [December 16, 2022, 1:18am UTC](https://meta.discourse.org/t/webhook-event-post-type/249088/1 "2022-12-16T01:18:01Z")

</div>

I’m integrating with the webhook, and when I receive a `Post` event, we have the `post_type` field. How can I find the type list? Do we have documentation about webhook events?

In resume, I wondering to discover if the user made a comment, shared a post, or another related event.

---

<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 16, 2022, 1:45am UTC](https://meta.discourse.org/t/webhook-event-post-type/249088/2 "2022-12-16T01:45:13Z")

</div>

> [@Lucas\_Alves](#):
>
> when I receive a `Post` event, we have the `post_type` field. How can I find the type list?

Maybe this should be documented here: [Configure webhooks that trigger on Discourse events to integrate with external services](https://meta.discourse.org/t/configure-webhooks-that-trigger-on-discourse-events-to-integrate-with-external-services/49045).

You can get the post types from the rails console by running `Post.types`. That returns

```plaintext
:regular=>1, :moderator_action=>2, :small_action=>3, :whisper=>4

```

> [@Lucas\_Alves](#):
>
> I wondering to discover if the user made a comment, shared a post, or another related event.

Any regular post on the site will have its `post_type` field set to 1 (regular.)

Post type 2 (moderator\_actions) is for posts that are generated when moderators handle flags in the review queue. I _think_ that’s the only time that post type is used.

Post type 3 (small\_actions) is for posts that are automatically generated when a topic is opened, closed, etc.

Post type 4 is for whisper posts.

---

<div class="post-metadata">

### Author: ![Lucas\_Alves](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucas_alves/32/285677_2.png) [@Lucas\_Alves](https://meta.discourse.org/u/Lucas_Alves)
#### Post date: [December 16, 2022, 9:19am UTC](https://meta.discourse.org/t/webhook-event-post-type/249088/3 "2022-12-16T09:19:58Z")

</div>

Got it.

Is there some way to know if the user created a post or just reply another post?  
And do we have the event when the user shares a topic/post?

---

<div class="post-metadata">

### Author: ![smileBeda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/smilebeda/32/272497_2.png) [@smileBeda](https://meta.discourse.org/u/smileBeda)
#### Post date: [February 22, 2023, 5:57am UTC](https://meta.discourse.org/t/webhook-event-post-type/249088/4 "2023-02-22T05:57:26Z")

</div>

@Lucas_Alves … must be so frustrating to just get no instructions, but also to completely miss any doc about it. Like, at least, for _me_ it is frustrating.

Now, since I found your post here which was exactly what _I_ was looking for, let me share how I detect if it is a “comment” (strictly speaking a POST that is a FOLLOW UP of any kind to the TOPIC)

1. the `post_type` is `1`
2. the `post_number` is greater than `1`
3. the `version` is `1`

If you want to specifically get only _replies_ to a specific _other coment_ you could use `reply_to_post_number` (if not empty, that is the post number of the post being replied to)

I hope this helps, and I wish, Discourse would call this object property `comment`, not `post`, just like they call `like` for Like actions!
