Merge endpoint for pull request returns 403 with PAT #178044
-
| Select Topic AreaQuestion BodyHello! I am the owner of the  There are no branch protection rules on the  I have issued myself a PAT, and have given the PAT read/write access to  https://docs.github.com/en/rest/authentication/permissions-required-for-fine-grained-personal-access-tokens?apiVersion=2022-11-28 However, if I  I am able to use the token to perform various read operations, so it's not a matter of not including the token in requests or anything like that. What am I doing wrong? | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
| That error message: 
 usually means your fine-grained personal access token (PAT) doesn’t have the exact permissions GitHub needs for that specific API call. Even though you gave it Contents: Read/Write, that permission only covers things like pushing commits or updating files. Here’s what to check Go to your Personal Access Tokens (fine-grained) Edit your token (or make a new one). Make sure the token is allowed to access the io7m-com/testartifact repository (fine-grained tokens can be repo-specific). Save and try the request again. Your call should look like this:  | 
Beta Was this translation helpful? Give feedback.

The problem was that the access token was owned by my account instead of the organization. 🤦
Edit: Set the "resource owner" to that of the organization in the token settings.