Skip to content

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-patterns

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.

Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.
curl https://api.g1t.sh/repos/flagon-io/hello/secret-scanning/custom-patterns \
-H "Authorization: Bearer $G1T_TOKEN"

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
}

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.