# List custom patterns

> List custom secret patterns: a repository's own and the ones it inherits from its workspace (with repo), or a workspace's (with workspace).

<div class="g1t-endpoint"><span class="g1t-method" data-method="get">GET</span><code>/repos/{owner}/{name}/secret-scanning/custom-patterns</code></div>

A repository's list includes its workspace's patterns, with `scope` `workspace`. `entitled` says whether they run here: always on a public repository, and on a private one when the workspace is on the g1t plan.

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`security`](/reference/mcp/#security) with `action` `patterns`, and the same inputs
- **Scope:** An access token needs [`security:read`](/guides/authentication/#scopes).
- **Also at:** [`GET /workspaces/{workspace}/secret-scanning/custom-patterns`](/reference/api/secret-scanning/list-custom-patterns-for-workspace/)

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |

## Example request

```sh
curl https://api.g1t.sh/repos/flagon-io/hello/secret-scanning/custom-patterns \
  -H "Authorization: Bearer $G1T_TOKEN"
```

## Example response

A successful request answers `200` with:

```json
{
  "patterns": [
    {
      "id": "pat_01kq2p9f6g7h8j9k0m1n2p3q4r",
      "scope": "repository",
      "workspace": "flagon-io",
      "repo": "hello",
      "name": "Acme API key",
      "pattern": "acme_[a-z0-9]{32}",
      "before": null,
      "after": null,
      "test_strings": [
        "ACME_KEY=acme_0123456789abcdef0123456789abcdef"
      ],
      "state": "published",
      "created_by": "syntaqx",
      "created_at": "2026-10-06T09:14:02.118Z",
      "updated_by": "syntaqx",
      "updated_at": "2026-10-06T09:14:02.118Z",
      "open_alerts": 0
    }
  ],
  "entitled": true
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
