List organization custom patterns
Lists secret scanning custom patterns for an organization.
Personal access tokens (classic) need the read:org scope to use this endpoint.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The organization name. The name is not case sensitive.
Query Parameters
Section titled “ Query Parameters ”Filter custom patterns by state. When absent, returns patterns in all states.
Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status.
The property to sort the results by.
The direction to sort the results by.
The page number of the results to fetch. For more information, see “Using pagination in the REST API.”
The number of results per page (max 100). For more information, see “Using pagination in the REST API.”
Responses
Section titled “ Responses ”Response
A custom pattern for secret scanning.
object
The ID of the custom pattern.
The name of the custom pattern.
The regular expression of the custom pattern.
A URL-friendly identifier for the custom pattern, derived from its name.
The state of the custom pattern.
Whether push protection is enabled for this custom pattern.
The start delimiter regex for the custom pattern.
The end delimiter regex for the custom pattern.
List of regexes that the secret must match.
List of regexes that the secret must not match.
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.
The date and time the custom pattern was created in ISO 8601 format.
The date and time the custom pattern was last updated in ISO 8601 format.
Examples
[ { "id": 1, "name": "Example Custom Pattern", "pattern": "[a-z]+_token_[0-9]+", "slug": "example-custom-pattern", "state": "published", "push_protection_enabled": true, "start_delimiter": null, "end_delimiter": null, "must_match": null, "must_not_match": null, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, { "id": 2, "name": "Another Custom Pattern", "pattern": "prefix_[a-zA-Z0-9]{32}", "slug": "another-custom-pattern", "state": "published", "push_protection_enabled": false, "start_delimiter": "\\b", "end_delimiter": "\\b", "must_match": [ "^prefix_prod" ], "must_not_match": [ "test" ], "created_at": "2024-01-16T14:20:00Z", "updated_at": "2024-01-17T09:15:00Z" }]Headers
Section titled “ Headers ”Example
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"Forbidden
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Resource not found
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}