---
title: "List enterprise custom patterns"
method: GET
path: "/enterprises/{enterprise}/secret-scanning/custom-patterns"
tags: ["secret-scanning"]
---

# List enterprise custom patterns

`GET /enterprises/{enterprise}/secret-scanning/custom-patterns`

Lists secret scanning custom patterns for an enterprise.

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

## Path parameters

- `enterprise` string, required

## Query parameters

- `state` 'published' | 'unpublished'
- `push_protection` 'enabled' | 'disabled'
- `sort` 'created' | 'updated' | 'name'
- `direction` 'asc' | 'desc'
- `page` integer
- `per_page` integer

## Response `200`

Response

- SecretScanningCustomPattern[]
  - `id` integer, required — The ID of the custom pattern.
  - `name` string, required — The name of the custom pattern.
  - `pattern` string, required — The regular expression of the custom pattern.
  - `slug` string, 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_enabled` boolean, required — Whether push protection is enabled for this custom pattern.
  - `start_delimiter` string, nullable — The start delimiter regex for the custom pattern.
  - `end_delimiter` string, nullable — The end delimiter regex for the custom pattern.
  - `must_match` string[], nullable — List of regexes that the secret must match.
  - `must_not_match` string[], nullable — List of regexes that the secret must not match.
  - `custom_pattern_version` string, 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_at` string, date-time — The date and time the custom pattern was created in ISO 8601 format.
  - `updated_at` string, date-time — The date and time the custom pattern was last updated in ISO 8601 format.

## Other responses

- `403` — Forbidden
- `404` — Resource not found

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
