REST API endpoints for secret scanning push protection

Use the REST API to manage secret scanning push protection.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List organization pattern configurations

GET /orgs/{org}/secret-scanning/pattern-configurations

Lists the secret scanning pattern configurations for an organization.
Personal access tokens (classic) need the read:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/secret-scanning/pattern-configurations

Response schema (Status: 200):

Update organization pattern configurations

PATCH /orgs/{org}/secret-scanning/pattern-configurations

Updates the secret scanning pattern configurations for an organization.
Personal access tokens (classic) need the write:org scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PATCH \
  https://api.github.com/orgs/ORG/secret-scanning/pattern-configurations \
  -d '{
  "pattern_config_version": "0ujsswThIGTUYm2K8FjOOfXtY1K",
  "provider_pattern_settings": [
    {
      "token_type": "GITHUB_PERSONAL_ACCESS_TOKEN",
      "push_protection_setting": "enabled"
    }
  ],
  "custom_pattern_settings": [
    {
      "token_type": "cp_2",
      "custom_pattern_version": "0ujsswThIGTUYm2K8FjOOfXtY1K",
      "push_protection_setting": "enabled"
    }
  ]
}'

Response schema (Status: 200):