# Delete Post from a Topic Using discourse API

**URL:** https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633
**Category:** Support
**Created:** [30 Giugno 2015, 11:36am UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633 "2015-06-30T11:36:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![User143](https://avatars.discourse-cdn.com/v4/letter/u/a87d85/32.png) [@User143](https://meta.discourse.org/u/User143)
#### Post date: [30 Giugno 2015, 11:36am UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633/1 "2015-06-30T11:36:36Z")

</div>

Is it possible to delete post from a Topic using Discourse API?

Corresponding user can only delete their POST.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [30 Giugno 2015, 10:03pm UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633/2 "2015-06-30T22:03:38Z")

</div>

Yes, if you can do it with the UI, you can do it via the API call. See the howto topic here titled “How to reverse engineer the Discourse API” for details.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [1 Luglio 2015, 5:18am UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633/5 "2015-07-01T05:18:10Z")

</div>

@User143 Review this topic:

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. The API is documented at [docs.discourse.org](https://docs.discourse.org). You can also use the [discourse\_api](https://github.com/discourse/discourse_api) Ruby gem as a client library. However, not every endpoint is documented. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select …

and and this text file specifically

[https://github.com/discourse/discourse\_api/blob/master/routes.txt#L71-L78](https://github.com/discourse/discourse_api/blob/master/routes.txt#L71-L78)

---

<div class="post-metadata">

### Author: ![User143](https://avatars.discourse-cdn.com/v4/letter/u/a87d85/32.png) [@User143](https://meta.discourse.org/u/User143)
#### Post date: [1 Luglio 2015, 5:38am UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633/6 "2015-07-01T05:38:56Z")

</div>

I reviewed with this topic but i need to delete particular post from a topic.

I just tried with the following HTTP post but its not working

`http://discourse.url.com/posts/1314/destroy_many/?api_key=test_beabcf136e&api_username=test_name`

For delete we need to use this URL.Is it right?

`destroy_many_posts DELETE /posts/destroy_many(.:format) `

I don’t have any clear picture about this API URL. Can you please give the example for deleting the post

When I delete post from chrome using the delete button. I am getting the following header from chrome but i don’t know how can i call this DELETE post API

```
Remote Address:120.80.217.8:80
Request URL:http://discourse.url.com/posts/1314
Request Method:DELETE
Status Code:200 OK

```

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [1 Luglio 2015, 10:23am UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633/7 "2015-07-01T10:23:53Z")

</div>

Look at it the info from Chrome again.

`Request URL: http://discourse.url.com/posts/1314`

The URL is the key here. It is accessing post id 1314. Now look at the Method

`Request Method: DELETE`

It is using DELETE, instead of POST, GET, etc.

Combine the two and it will delete the post (so long as you also pass in the API\_KEY and API\_Username

---

<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: [19 Ottobre 2018, 10:29am UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633/8 "2018-10-19T10:29:38Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [22 Ottobre 2018, 3:52am UTC](https://meta.discourse.org/t/delete-post-from-a-topic-using-discourse-api/30633/9 "2018-10-22T03:52:19Z")

</div>


