# DELETE host using API (II)

**URL:** <https://community.influxdata.com/t/delete-host-using-api-ii/3375>\
**Category:** Systems\
**Created:** [December 12, 2017, 4:40am UTC](https://community.influxdata.com/t/delete-host-using-api-ii/3375 "2017-12-12T04:40:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![me2017](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@me2017](https://community.influxdata.com/u/me2017)\
**Post date:** [December 12, 2017, 4:40am UTC](https://community.influxdata.com/t/delete-host-using-api-ii/3375/1 "2017-12-12T04:40:01Z")

</div>

I asked this question earlier but didn’t receive any responses. I’m posting again in hopes that someone has worked with the API or deleted data from their db.

I am trying to find a means to remove hosts from influx using the API. I’ve tried a variety of syntax similar to:

`curl -i -XPOST 'http://localhost:8086/query?db=telegraf' --data-binary @/tmp/myinflux.txt`  
`{"results":[{"statement_id":0}]}`

myinflux.txt:

`q=DELETE FROM system WHERE host = 'web001'`

I can do this successfully via influx cli:

```
> use telegraf
Using database telegraf
> DELETE FROM system WHERE host = 'web001'

```

What is wrong with the API command?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [December 12, 2017, 7:32pm UTC](https://community.influxdata.com/t/delete-host-using-api-ii/3375/2 "2017-12-12T19:32:54Z")

</div>

I think this will work:

```auto
drop series from system where host = 'web001'

```

---

<div class="post-metadata">

**Author:** ![mcooper59](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mcooper59/32/2148_2.png) [@mcooper59](https://community.influxdata.com/u/mcooper59)\
**Post date:** [September 22, 2018, 8:41am UTC](https://community.influxdata.com/t/delete-host-using-api-ii/3375/3 "2018-09-22T08:41:20Z")

</div>

> [@daniel](#):
>
> drop series from system where host = ‘web001’

Where do I perform this from? The influx cli?

Thanks,
