# Not able to delete a decision with an API (cookie-token is missing)

**URL:** https://discourse.crowdsec.net/t/not-able-to-delete-a-decision-with-an-api-cookie-token-is-missing/985
**Category:** crowdsec
**Created:** [October 12, 2022, 9:13pm UTC](https://discourse.crowdsec.net/t/not-able-to-delete-a-decision-with-an-api-cookie-token-is-missing/985 "2022-10-12T21:13:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ayucel](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@ayucel](https://discourse.crowdsec.net/u/ayucel)
#### Post date: [October 12, 2022, 9:13pm UTC](https://discourse.crowdsec.net/t/not-able-to-delete-a-decision-with-an-api-cookie-token-is-missing/985/1 "2022-10-12T21:13:41Z")

</div>

Hello there, I’ve been trying to delete the decisions via API, but it seems like I’m missing a cookie-token.  
Here’s the output that I get:

{“code”:401,“message”:“cookie token is empty”}

As well as I’ve noticed in the [Swagger UI](https://crowdsecurity.github.io/api_doc/index.html?urls.primaryName=LAPI#/) it mentions that “Delete decision for given ban ID (only from cscli)”. So I’m wondering if we’re not able to delete decisions from an HTTP API call?

Thank you.

---

<div class="post-metadata">

### Author: ![iiAmLoz](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/iiamloz/32/386_2.png) [@iiAmLoz](https://discourse.crowdsec.net/u/iiAmLoz)
#### Post date: [October 14, 2022, 8:41am UTC](https://discourse.crowdsec.net/t/not-able-to-delete-a-decision-with-an-api-cookie-token-is-missing/985/2 "2022-10-14T08:41:30Z")

</div>

You can delete via the API, however, you need to pass a JWT token as the header that you get from sending valid credentials to `/v1/watchers/login`. So the flow is  
`POST /v1/watchers/login` → Set `Authorization: Bearer ${jwt}` → Send `DELETE /v1/decisions/${ID}`

---

<div class="post-metadata">

### Author: ![iiAmLoz](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/iiamloz/32/386_2.png) [@iiAmLoz](https://discourse.crowdsec.net/u/iiAmLoz)
#### Post date: [October 14, 2022, 8:45am UTC](https://discourse.crowdsec.net/t/not-able-to-delete-a-decision-with-an-api-cookie-token-is-missing/985/3 "2022-10-14T08:45:06Z")

</div>

For more information the `cscli` command interacts with crowdsec over the http API. If you need to know where the valid credentials are for your machine the local api is stored `/etc/crowdsec/local_api_credentials.yaml`

---

<div class="post-metadata">

### Author: ![ayucel](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@ayucel](https://discourse.crowdsec.net/u/ayucel)
#### Post date: [October 14, 2022, 6:15pm UTC](https://discourse.crowdsec.net/t/not-able-to-delete-a-decision-with-an-api-cookie-token-is-missing/985/4 "2022-10-14T18:15:07Z")

</div>

Thank you, much appreciated.
