Skip to content

Bulk delete repository custom patterns

DELETE
/repos/{owner}/{repo}/secret-scanning/custom-patterns

Bulk deletes secret scanning custom patterns for a repository.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

Media type application/json
object
patterns
required

The list of custom patterns to delete.

Array<object>
<= 500 items
Secret Scanning Custom Pattern To Delete

A custom pattern to delete in a bulk operation.

object
pattern_id
required

The ID of the custom pattern to delete.

integer
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
post_delete_action

What to do with alerts associated with the deleted patterns. delete_alerts permanently removes the alerts. resolve_alerts resolves the alerts as “pattern deleted”. Defaults to delete_alerts when not specified.

string
default: delete_alerts
Allowed values: delete_alerts resolve_alerts
Examples
Example default
{
"patterns": [
{
"pattern_id": 2,
"custom_pattern_version": "0ujsswThIGTUYm2K8FjOOfXtY1K"
}
]
}

All patterns deleted successfully.

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"
}

Precondition Failed

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"
}