v56

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

Update an enterprise custom pattern

Updates a secret scanning custom pattern for an enterprise.

Personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

patch/enterprises/{enterprise}/secret-scanning/custom-patterns/{pattern_id}

Path parameters

enterprisestring required

The slug version of the enterprise name.

pattern_idinteger required

The ID of the custom pattern.

Request body

OR
OR
OR
OR

Response

Pattern updated successfully.

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.