Secrets

Override the validity of a secret

Changed on

Override 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 URL
    https://api.gitguardian.com
  • URL
    https://api.gitguardian.com/v1/secrets/{secret_id}/validity
  • Auth
    HTTP bearer

Path parameters

secret_idinteger required

The ID of the secret to update

Request body

validity'valid' | 'invalid' | 'failed_to_check' required

Validity status to push as an override. Only valid, invalid and failed_to_check are accepted as customer-provided results.

Example request

{
  "validity": "invalid"
}

Response

The validity override was set.

idinteger
validity'valid' | 'invalid' | 'failed_to_check' | 'no_checker' | 'unknown' nullable

Current validity of the secret (reflects the override while it is set).

validity_override'valid' | 'invalid' | 'failed_to_check' | 'no_checker' | 'unknown' nullable

The validity override currently set on the secret, or null if none.

last_checked_atstring date-time nullable

Date of the last validity check GitGuardian ran on the secret, or null if never checked.

Example response

{
  "id": 1,
  "validity": "invalid",
  "validity_override": "invalid",
  "last_checked_at": "2026-10-20T13:00:00Z"
}

Changes