# CrowdSec LAPI tokens

**URL:** https://discourse.crowdsec.net/t/crowdsec-lapi-tokens/1226
**Category:** crowdsec
**Created:** [March 29, 2023, 6:57pm UTC](https://discourse.crowdsec.net/t/crowdsec-lapi-tokens/1226 "2023-03-29T18:57:34Z")
**Posts on this page:** 3
**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: [March 29, 2023, 6:57pm UTC](https://discourse.crowdsec.net/t/crowdsec-lapi-tokens/1226/1 "2023-03-29T18:57:34Z")

</div>

We’re trying to find a solution with CrowdSec’s Swagger API and I would like to know what happens to generated token via ‘POST’ watchers/login after we generate a new session with the same ‘POST’ method? Does it expires once we generate a new token or does it stays active until it’s expiration date? Also can we modify it’s expiration time period?

When I try to use ‘GET’ method for decisions, I keep getting following response:

{“message”:“access forbidden”}

How do you authenticate bouncers via API, seems like it doesn’t accept watchers/login generated token?

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: [March 30, 2023, 7:34am UTC](https://discourse.crowdsec.net/t/crowdsec-lapi-tokens/1226/2 "2023-03-30T07:34:44Z")

</div>

The swagger documentation is split between JWT based auth (watchers) and X-Api-Key header auth (bouncers). Bouncer have only access to read data from the decision routes , they can be generated through (`cscli bouncers add mybouncer`). JWT auth is read/write access, the JWT token does not expire if a new one is generated as we do not know from the context if a client is reusing credentials, atm there is no option to modify the expiration date.

For bouncer you must only use the X-Api-Key token to access those routes. Routes cannot be access by either they are scoped to what they can access via swagger docs.

---

<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: [March 30, 2023, 10:55pm UTC](https://discourse.crowdsec.net/t/crowdsec-lapi-tokens/1226/3 "2023-03-30T22:55:55Z")

</div>

Thank you for a well explanation and quick response.

🙌
