Problem
After a GitHub VCS integration has been configured, a workspace can then be assigned to a repository within the GitHub VCS. In some cases the following error may appear despite the VCS integration being configured correctly:
"Error saving version control settings
Failed to create webhook on repository: 404 Not Found"
Cause
The cause is often a lack of administrative permissions on the account that was used to create the OAuth authentication with GitHub. From step 2 in the documentation listed below we read:
Important: The account you use for connecting Terraform Cloud must have admin access to any shared repositories of Terraform configurations, since creating webhooks requires admin permissions
Solution
The account you logged into GitHub as, to create the OAuth application, is the account which needs admin access to the repositories in question.
Additional Information
Full details on the oauth configuration process can be read here:
https://www.terraform.io/docs/cloud/vcs/github.html
Permission level settings for a GitHub repository can be read here:
https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization