Secrets

Get the validity of a secret

Changed on

Retrieve the current validity status of a secret together with its validity override. validity_override is null when no override is set.

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:read scope. Both personal access tokens and service account tokens are accepted.
get/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

Response

The secret validity and validity override.

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