v68

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,21696712.3 MB
secret-scanning

List repository custom patterns

Lists 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.

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

Path parameters

ownerstring required

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

repostring required

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

Query parameters

state'published' | 'unpublished'

Filter custom patterns by state. When absent, returns patterns in all states.

push_protection'enabled' | 'disabled'

Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status.

sort'created' | 'updated' | 'name'

The property to sort the results by.

direction'asc' | 'desc'

The direction to sort the results by.

pageinteger

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

per_pageinteger

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Response

Response

idinteger required

The ID of the custom pattern.

namestring required

The name of the custom pattern.

patternstring required

The regular expression of the custom pattern.

slugstring required

A URL-friendly identifier for the custom pattern, derived from its name.

state'published' | 'unpublished' required

The state of the custom pattern.

push_protection_enabledboolean required

Whether push protection is enabled for this custom pattern.

start_delimiterstring nullable

The start delimiter regex for the custom pattern.

end_delimiterstring nullable

The end delimiter regex for the custom pattern.

must_matchstring[] nullable

List of regexes that the secret must match.

must_not_matchstring[] nullable

List of regexes that the secret must not match.

custom_pattern_versionstring nullable

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.

created_atstring date-time

The date and time the custom pattern was created in ISO 8601 format.

updated_atstring date-time

The date and time the custom pattern was last updated in ISO 8601 format.