Skip to content

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.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

Media type application/json
object
pattern_config_version

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.

string
nullable
provider_pattern_settings

Pattern settings for provider patterns.

Array<object>
object
token_type

The ID of the pattern to configure.

string
push_protection_setting

Push protection setting to set for the pattern.

string
Allowed values: not-set disabled enabled
custom_pattern_settings

Pattern settings for custom patterns.

Array<object>
object
token_type

The ID of the pattern to configure.

string
custom_pattern_version

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.

string
nullable
push_protection_setting

Push protection setting to set for the pattern.

string
Allowed values: disabled enabled
Examples
Example default
{
"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

Media type application/json
object
pattern_config_version

The updated pattern configuration version.

string
Examples
Example default
{
"pattern_config_version": "0ujsswThIGTUYm2K8FjOOfXtY1K"
}

Bad Request

Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Forbidden

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Conflict

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error

Validation Error

object
message
required
string
documentation_url
required
string
errors
Array<object>
object
resource
string
field
string
message
string
code
required
string
index
integer
value
One of:
string
nullable
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
{
"resource": "example",
"field": "example",
"message": "example",
"code": "example",
"index": 1,
"value": [
"example"
]
}
]
}