{"meta":{"title":"Working with push protection from the REST API","intro":"Learn your options for unblocking your push to GitHub using the REST API if secret scanning detects a secret in the content of your API request.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/concepts","title":"Concepts"},{"href":"/en/code-security/concepts/secret-security","title":"Secret security"},{"href":"/en/code-security/concepts/secret-security/push-protection-from-the-rest-api","title":"Push protection from the REST API"}],"documentType":"article"},"body":"# Working with push protection from the REST API\n\nLearn your options for unblocking your push to GitHub using the REST API if secret scanning detects a secret in the content of your API request.\n\n## About push protection from the REST API\n\nPush protection prevents you from accidentally committing secrets to a repository by blocking pushes containing supported secrets.\n\nThe \"Create a blob\" and \"Create or update file contents\" endpoints in the REST API include push protection. See [REST API endpoints for Git blobs](/en/rest/git/blobs?apiVersion=2022-11-28#create-a-blob) and [REST API endpoints for repository contents](/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents).\n\nIf you make a request with these endpoints whose content includes a supported secret, the REST API will return a 409 error, indicating that a secret has been detected.\n\nTo resolve the error, you can either:\n\n* **Remove** the secret from the content of your API request before trying again.\n* **Create a push protection bypass:** You can bypass push protection using the \"Create a push protection bypass\" endpoint. For more information, see [REST API endpoints for secret scanning](/en/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#create-a-push-protection-bypass).\n\n## Further reading\n\n* [Working with push protection from the command line](/en/code-security/how-tos/secure-your-secrets/work-with-leak-prevention/push-protection-on-the-command-line)\n* [Working with push protection in the GitHub UI](/en/code-security/how-tos/secure-your-secrets/work-with-leak-prevention/push-protection-in-the-github-ui)"}