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.
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/secret-scanning/pattern-configurations
Response schema (Status: 200):
pattern_config_version: string or nullprovider_pattern_overrides: array of objects:
token_type: stringcustom_pattern_version: string or nullslug: stringdisplay_name: stringalert_total: integeralert_total_percentage: integerfalse_positives: integerfalse_positive_rate: integerbypass_rate: integerdefault_setting: string, enum: disabled, enabledenterprise_setting: string or null, enum: not-set, disabled, enabled, nullsetting: string, enum: not-set, disabled, enabledcustom_pattern_overrides: array of objects:
token_type: stringcustom_pattern_version: string or nullslug: stringdisplay_name: stringalert_total: integeralert_total_percentage: integerfalse_positives: integerfalse_positive_rate: integerbypass_rate: integerdefault_setting: string, enum: disabled, enabledenterprise_setting: string or null, enum: not-set, disabled, enabled, nullsetting: string, enum: not-set, disabled, enabledPATCH /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.
accept (string)application/vnd.github+json is recommended.org (string) (required)pattern_config_version (string or null)
The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update.
provider_pattern_settings (array of objects)
Pattern settings for provider patterns.
token_type (string)push_protection_setting (string)not-set, disabled, enabledcustom_pattern_settings (array of objects)
Pattern settings for custom patterns.
token_type (string)custom_pattern_version (string or null)push_protection_setting (string)disabled, enabled200 - OK
400 - Bad Request
403 - Forbidden
404 - Resource not found
409 - Conflict
422 - Validation failed, or the endpoint has been spammed.
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):
pattern_config_version: string