Does Discourse have support for PAT tokens?

AI-generated summary

PAT Token Support in Discourse

Gokul_Ks inquired about support for PAT tokens in Discourse. blake suggested creating an API key assigned to a specific user, which uses the same user permissions as when logged in. Additionally, mattdm mentioned user-provisioned API keys, which can be enabled.

Gokul_Ks attempted to request a user API key but encountered a 404 error. blake replied that Discourse does not have a webhook that triggers when a user API key is requested. Instead, blake asked if Gokul_Ks is trying to use one of the available events to trigger the webhook.

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?

You can create an api key assigned to a specific user and it will use the same user permissions that they have access to when logged in.

There are also (if enabled), user-provisioned API keys.

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

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

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