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).
GET
/repos/{owner}/{name}/secret-scanning/custom-patternsA 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 as
Authorization: Bearer. - MCP tool:
securitywithactionpatterns, and the same inputs - Scope: An access token needs
security:read. - Also at:
GET /workspaces/{workspace}/secret-scanning/custom-patterns
Path parameters
Section titled “Path parameters”| Name | Type | Required | Description |
|---|---|---|---|
owner |
string | Yes | The workspace that owns the repository. |
name |
string | Yes | The repository’s name. |
Example request
Section titled “Example request”curl https://api.g1t.sh/repos/flagon-io/hello/secret-scanning/custom-patterns \ -H "Authorization: Bearer $G1T_TOKEN"Example response
Section titled “Example response”A successful request answers 200 with:
{ "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
Section titled “Errors”A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See 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. |