# Does Discourse have support for PAT tokens?

**URL:** https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488
**Category:** Development
**Tags:** rest-api
**Created:** [March 17, 2023, 11:00am UTC](https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488 "2023-03-17T11:00:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Gokul\_Ks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gokul_ks/32/298442_2.png) [@Gokul\_Ks](https://meta.discourse.org/u/Gokul_Ks)
#### Post date: [March 17, 2023, 11:00am UTC](https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488/1 "2023-03-17T11:00:34Z")

</div>

Is there support for PAT tokens in Discourse. There is a particular use-case we are working on that we might need PAT tokens. If yes, where can I find them?

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [March 17, 2023, 6:36pm UTC](https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488/2 "2023-03-17T18:36:03Z")

</div>

You can [create an api key assigned to a specific user](https://meta.discourse.org/t/create-and-configure-an-api-key/230124) and it will use the same user permissions that they have access to when logged in.

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [March 18, 2023, 3:09pm UTC](https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488/3 "2023-03-18T15:09:32Z")

</div>

There are also (if enabled), _user-provisioned_ API keys.

> [@User API keys specification](https://meta.discourse.org/t/user-api-keys-specification/48536):
>
> Discourse contains a system for generating API keys per user if a very specific protocol is followed. This feature facilitates “application” access to Discourse instances without needing to involve moderators. High level description At a high level: Client (desktop app, browser plugin, mobile app) generates a private/public key pair and return url Client redirects to a route on discourse giving discourse its public key Discourse gets approval from user to use app Discourse generat…

---

<div class="post-metadata">

### Author: ![Gokul\_Ks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gokul_ks/32/298442_2.png) [@Gokul\_Ks](https://meta.discourse.org/u/Gokul_Ks)
#### Post date: [March 19, 2023, 11:27am UTC](https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488/4 "2023-03-19T11:27:43Z")

</div>

![Screenshot 2023-03-19 at 4.56.45 PM](https://global.discourse-cdn.com/meta/original/4X/8/0/7/8074604f50ece7171b1ec631164e0ca6dacee1f1.png)

Tried out this request but it didn’t work, am I doing something wrong here?

I’m testing out things such that a webhook gets triggered when I request a user api key

I’m getting a 404 error

---

<div class="post-metadata">

### Author: ![Gokul\_Ks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gokul_ks/32/298442_2.png) [@Gokul\_Ks](https://meta.discourse.org/u/Gokul_Ks)
#### Post date: [March 19, 2023, 11:51am UTC](https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488/5 "2023-03-19T11:51:57Z")

</div>

![Screenshot 2023-03-19 at 5.21.27 PM](https://global.discourse-cdn.com/meta/original/4X/b/5/a/b5ab4e049b2dd6aa1d859f372ae637231b2a2210.png)

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [March 19, 2023, 1:15pm UTC](https://meta.discourse.org/t/does-discourse-have-support-for-pat-tokens/258488/6 "2023-03-19T13:15:49Z")

</div>

> [@Gokul\_Ks](#):
>
> I’m testing out things such that a webhook gets triggered when I request a user api key

I don’t believe discourse has a webhook that will trigger when a “user api key” is requested.

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/8/d/a8de1c29db43d9a9d6bc4aac9e45ca3225c711f2.png)

Are you trying to use one of these events to trigger the webhook?
