Secrets
Override the validity of a secret
Changed onOverride the validity status of a secret with a customer-provided value.
While an override is set, GitGuardian stops running its periodic validity checks for the secret and the override value is reflected on the secret's validity.
Access requires the token to see at least one incident linked to the secret, private or public.
Prerequisites:
- A valid API key with the secrets:write scope. Both personal access tokens and service account tokens are accepted.
post/v1/secrets/{secret_id}/validity
Request
- Base URLhttps://api.gitguardian.com
- URLhttps://api.gitguardian.com/v1/secrets/{secret_id}/validity
- AuthHTTP bearer
Path parameters
secret_idinteger required
The ID of the secret to update
Request body
Example request
{
"validity": "invalid"
}Response
The validity override was set.
Example response
{
"id": 1,
"validity": "invalid",
"validity_override": "invalid",
"last_checked_at": "2026-10-20T13:00:00Z"
}Changes
- info
added the optional property
to the response with the status
- info