I'm trying to create a Personal Access token (PAT) using the REST API by sending a POST request with the following body:
{
"name": "tokenName",
"expirationDuration": 90
}to
{{baseUrlOfYourInstance}}/rest/pat/latest/tokens but I keep getting a 401 Unauthorized error back. The documentation here doesn't specify how to authenticate initially when trying to obtain a personal access token via the REST API. It just states to do what I am doing and you should get a personal access token back.
Do you need to use basic auth first in order to get the PAT and then future requests can just use the PAT for authentication?