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/workspaces/{workspace}/secret-scanning/custom-patterns
Name Type Required Description
workspace string Yes Instead of repo: the workspace’s slug, for all of it (or its own, for patterns).
curl https://api.g1t.sh/workspaces/flagon-io/secret-scanning/custom-patterns \
-H "Authorization: Bearer $G1T_TOKEN"

A successful request answers 200 with:

{
"patterns": [
{
"id": "pat_01kq2p9f6g7h8j9k0m1n2p3q4r",
"scope": "workspace",
"workspace": "flagon-io",
"repo": null,
"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.