# API InfluxDB 2.0: Delete time series data (auth. problem)

**URL:** <https://community.influxdata.com/t/api-influxdb-2-0-delete-time-series-data-auth-problem/18491>\
**Category:** InfluxDB 2\
**Tags:** influxdb\
**Created:** [February 22, 2021, 6:26am UTC](https://community.influxdata.com/t/api-influxdb-2-0-delete-time-series-data-auth-problem/18491 "2021-02-22T06:26:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jennerwein](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jennerwein](https://community.influxdata.com/u/jennerwein)\
**Post date:** [February 22, 2021, 6:26am UTC](https://community.influxdata.com/t/api-influxdb-2-0-delete-time-series-data-auth-problem/18491/1 "2021-02-22T06:26:41Z")

</div>

Trying the code:

> curl --request POST   
> [http://localhost:8086/api/v2/query?org=privat](http://localhost:8086/api/v2/query?org=privat)  
> –header “Authorization: Token $TOKEN”   
> –header ‘Accept: application/csv’   
> –header ‘Content-type: application/vnd.flux’   
> –data ‘from(bucket:“finanz-test”)  
> |\> range(start: 2021-02-21T15:48:06.270251807Z)  
> |\> filter(fn: (r) =\> r[“\_measurement”] == “Kurse”)  
> |\> filter(fn: (r) =\> r[“ISIN”] == “Fut\_DAX”)’

everything works fine. BUT for:

> curl --request POST   
> [http://0.0.0.0:8086/api/v2/delete/?org=privat&bucket=finanz-test](http://0.0.0.0:8086/api/v2/delete/?org=privat&bucket=finanz-test)  
> –header “Authorization: Token $TOKEN”   
> –header ‘Content-Type: application/json’   
> –data ‘{ “start”: “2021-02-21T15:48:06.270251807Z”, “stop”: “2021-02-21T15:50:11.267979687Z” }’

I get the message `{"code":"unauthorized","message":"unauthorized access"}`. It is the same authorization, I don’t understand the difference.  
I use docker with `influxdb:v2.0.4`.

---

<div class="post-metadata">

**Author:** ![Anis](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@Anis](https://community.influxdata.com/u/Anis)\
**Post date:** [February 22, 2021, 7:37am UTC](https://community.influxdata.com/t/api-influxdb-2-0-delete-time-series-data-auth-problem/18491/2 "2021-02-22T07:37:04Z")

</div>

Hello,

Try to use the administrator Token for deleting data. And tell us !

---

<div class="post-metadata">

**Author:** ![jennerwein](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jennerwein](https://community.influxdata.com/u/jennerwein)\
**Post date:** [February 22, 2021, 8:35am UTC](https://community.influxdata.com/t/api-influxdb-2-0-delete-time-series-data-auth-problem/18491/3 "2021-02-22T08:35:14Z")

</div>

Yes, I use the `admin's Token`.  
I also tried a fresh generated “All Access Token”, but it also doesn’t work.

---

<div class="post-metadata">

**Author:** ![dan-moran](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dan-moran/32/5885_2.png) [@dan-moran](https://community.influxdata.com/u/dan-moran)\
**Post date:** [March 1, 2021, 8:35pm UTC](https://community.influxdata.com/t/api-influxdb-2-0-delete-time-series-data-auth-problem/18491/4 "2021-03-01T20:35:50Z")

</div>

@jennerwein can you open an issue on GitHub?

---

<div class="post-metadata">

**Author:** ![jennerwein](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jennerwein](https://community.influxdata.com/u/jennerwein)\
**Post date:** [March 2, 2021, 9:11am UTC](https://community.influxdata.com/t/api-influxdb-2-0-delete-time-series-data-auth-problem/18491/5 "2021-03-02T09:11:19Z")

</div>

@dan-moran Yes, I did open an issue.
