# API to retrieve the Personal Access token in JIRA?

**URL:** https://forum.library.adaptavist.com/t/api-to-retrieve-the-personal-access-token-in-jira/128
**Category:** ScriptRunner
**Tags:** api, jira
**Created:** [April 28, 2022, 3:18pm UTC](https://forum.library.adaptavist.com/t/api-to-retrieve-the-personal-access-token-in-jira/128 "2022-04-28T15:18:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![krishnanayak](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/krishnanayak/32/65_2.png) [@krishnanayak](https://forum.library.adaptavist.com/u/krishnanayak)
#### Post date: [April 28, 2022, 3:18pm UTC](https://forum.library.adaptavist.com/t/api-to-retrieve-the-personal-access-token-in-jira/128/1 "2022-04-28T15:18:16Z")

</div>

Is there a api in jira that can be used to retrieve the Personal Access Token?

---

<div class="post-metadata">

### Author: ![mgarcia](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/mgarcia/32/35_2.png) [@mgarcia](https://forum.library.adaptavist.com/u/mgarcia)
#### Post date: [April 29, 2022, 6:58am UTC](https://forum.library.adaptavist.com/t/api-to-retrieve-the-personal-access-token-in-jira/128/2 "2022-04-29T06:58:52Z")

</div>

Hello @krishnanayak,

Thanks for raising this question 🙂

I think that it can be provided via the REST API, as it’s posted [here](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html):

> Creating PATs using REST API  
> Send a POST HTTP request with the following body:
> 
> ```auto
> {
> "name": "tokenName",
> "expirationDuration": 90
> }
> 
> ```
> 
> Though the `expirationDuration` parameter, you can define the number of days for which your token will remain valid.  
> to the following address:
> 
> ```auto
> {{baseUrlOfYourInstance}}/rest/pat/latest/tokens
> 
> ```
> 
> In response, you’ll receive the PAT.

I hope you can find this useful 😉

Please, let me know if this has work for you.

Regards,  
Miguel.

---

<div class="post-metadata">

### Author: ![krishnanayak](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.library.adaptavist.com/krishnanayak/32/65_2.png) [@krishnanayak](https://forum.library.adaptavist.com/u/krishnanayak)
#### Post date: [May 12, 2022, 1:27pm UTC](https://forum.library.adaptavist.com/t/api-to-retrieve-the-personal-access-token-in-jira/128/3 "2022-05-12T13:27:31Z")

</div>

thanks. will try this and see if works for our use case. I tried to look at the available api but there is nothing that talks about retrieving an already create PAT
