# How to detect draft topic via webhooks?

**URL:** https://meta.discourse.org/t/how-to-detect-draft-topic-via-webhooks/102797
**Category:** Support
**Created:** [November 26, 2018, 6:10pm UTC](https://meta.discourse.org/t/how-to-detect-draft-topic-via-webhooks/102797 "2018-11-26T18:10:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SystemZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/systemz/32/88354_2.png) [@SystemZ](https://meta.discourse.org/u/SystemZ)
#### Post date: [November 26, 2018, 6:10pm UTC](https://meta.discourse.org/t/how-to-detect-draft-topic-via-webhooks/102797/1 "2018-11-26T18:10:01Z")

</div>

Hi, I have custom Discourse webhook integration for notifications about new topics in chat server and I started to use draft feature for staff.

Unfortunately I don’t see any variable that I can check for to prevent exposing staff-stuff to regular users.

Am I missing something?

```plaintext
Request URL: <redacted>
Request method: POST
Accept: */*
Connection: close
Content-Length: 1063
Content-Type: application/json
Host: <redacted>
User-Agent: Discourse/2.2.0.beta4
X-Discourse-Instance: <redacted>
X-Discourse-Event-Id: 9605
X-Discourse-Event-Type: topic
X-Discourse-Event: topic_created
X-Discourse-Event-Signature: sha256=<redacted>

```

```plaintext
{
  "topic": {
    "tags": [],
    "id": 9091,
    "title": "<redacted>",
    "fancy_title": "<redacted>",
    "posts_count": 1,
    "created_at": "2018-11-26T18:01:33.367Z",
    "views": 0,
    "reply_count": 0,
    "like_count": 0,
    "last_posted_at": "2018-11-26T18:01:33.521Z",
    "visible": true,
    "closed": false,
    "archived": false,
    "archetype": "regular",
    "slug": "<redacted>",
    "category_id": 4,
    "word_count": 4,
    "deleted_at": null,
    "pending_posts_count": 0,
    "user_id": 1,
    "featured_link": null,
    "pinned_globally": false,
    "pinned_at": null,
    "pinned_until": null,
    "unpinned": null,
    "pinned": false,
    "highest_post_number": 1,
    "deleted_by": null,
    "has_deleted": false,
    "bookmarked": null,
    "participant_count": 1,
    "created_by": {
      "id": 1,
      "username": "<redacted>",
      "name": "<redacted>",
      "avatar_template": "<redacted>"
    },
    "last_poster": {
      "id": 1,
      "username": "<redacted>",
      "name": "<redacted>",
      "avatar_template": "<redacted>"
    }
  }
}

```

---

<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: [November 26, 2018, 6:53pm UTC](https://meta.discourse.org/t/how-to-detect-draft-topic-via-webhooks/102797/2 "2018-11-26T18:53:12Z")

</div>

When a shared draft is created, the `category_id` will be set to the ID of the shared drafts category. You could try checking the `category_id` and then not publishing the topic if it comes from your shared drafts category.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 25, 2021, 6:27am UTC](https://meta.discourse.org/t/how-to-detect-draft-topic-via-webhooks/102797/3 "2021-09-25T06:27:22Z")

</div>


