markFileAsViewed GraphQL mutation returns "Resource not accessible by personal access token" with fine-grained PAT
#200353
-
🏷️ Discussion TypeBug 💬 Feature/Topic AreaAPI BodyI'm working with the GitHub GraphQL API and trying to use the Token permissions:
The API response is: {
"data": {
"markFileAsViewed": null
},
"errors": [
{
"type": "FORBIDDEN",
"path": ["markFileAsViewed"],
"extensions": {
"saml_failure": false
},
"message": "Resource not accessible by personal access token"
}
]
}Are there any additional permissions required to use this mutation? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
The issue is that fine-grained PATs require explicit repository-level access in addition to the right permissions. The Two things to check:
For context, classic PATs with the You can verify by creating a new fine-grained PAT that targets "All repositories" with |
Beta Was this translation helpful? Give feedback.
The issue is that fine-grained PATs require explicit repository-level access in addition to the right permissions.
The
markFileAsViewedmutation needspull_requests: writepermission (which you already have), but the PAT must also be installed on the specific repository containing the PR.Two things to check:
Repository access: When creating the fine-grained PAT, did you select "All repositories" or only "Only select repositories"? If the repo containing the PR isn't explicitly selected, you will get this error. Go to https://github.com/settings/tokens and check the PAT's repository access.
Organization restrictions: If the repository belongs to an organization that has blocked fine-g…