# Create PAT only with session token in pyBIS

**URL:** <https://community.openbis.ch/t/create-pat-only-with-session-token-in-pybis/175>\
**Category:** Developments\
**Created:** [19 May 2023 08:04 UTC](https://community.openbis.ch/t/create-pat-only-with-session-token-in-pybis/175 "2023-05-19T08:04:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.openbis.ch/kerzel/32/30_2.png) [@kerzel](https://community.openbis.ch/u/kerzel)\
**Post date:** [19 May 2023 08:04 UTC](https://community.openbis.ch/t/create-pat-only-with-session-token-in-pybis/175/1 "2023-05-19T08:04:48Z")

</div>

Dear all,

using pyBIS v 1.35.1, I noticed that when I want to create a new personal access token, I can only do so with a session token but not with an existing PAT?  
( I can get a list of existing PATs with a valid PAT but cannot create a new one unless I use a session token)

all the best  
Ulrich

---

<div class="post-metadata">

**Author:** ![juanf](https://dub1.discourse-cdn.com/flex013/user_avatar/community.openbis.ch/juanf/32/18_2.png) [@juanf](https://community.openbis.ch/u/juanf)\
**Post date:** [22 May 2023 10:59 UTC](https://community.openbis.ch/t/create-pat-only-with-session-token-in-pybis/175/2 "2023-05-22T10:59:14Z")

</div>

That behaviour is the expected behaviour. You can only create PAT from a session token.

PAT are supposed to be shared around on different machines where batch Jobs are installed.

If one of these machines is compromised you want to be able to delete PATs and avoid the creation of new ones. So you are not compromised for further time than the PAT lasts.

Those PATs would be updated using the session token of the admin from a script only the admin can run.

I hope this makes sense.

---

<div class="post-metadata">

**Author:** ![kerzel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.openbis.ch/kerzel/32/30_2.png) [@kerzel](https://community.openbis.ch/u/kerzel)\
**Post date:** [22 May 2023 13:41 UTC](https://community.openbis.ch/t/create-pat-only-with-session-token-in-pybis/175/3 "2023-05-22T13:41:16Z")

</div>

Dear Juan,

many thanks - this makes total sense, thank you for pointing this out.

All the best  
Ulrich
