---
title: "Request a new validity check of a secret"
method: POST
path: "/v1/secrets/{secret_id}/validity/check"
tags: ["Secrets"]
---

# Request a new validity check of a secret

`POST /v1/secrets/{secret_id}/validity/check`

## Request

- Base URL: `https://api.gitguardian.com`
- URL: `https://api.gitguardian.com/v1/secrets/{secret_id}/validity/check`
- Auth: HTTP bearer

Request a new validity check of a secret, to find out whether it is still
valid.

The check runs asynchronously: a `202` means it was accepted, not that it
completed. Read the [secret validity](#operation/get-secret-validity) back
and compare its `last_checked_at` to get the refreshed validity.

A `202` does not guarantee that a new check was enqueued. No check runs for
a secret checked less than 5 minutes ago, a secret with a validity override,
or a secret GitGuardian cannot check.

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.
  - Secret validity checks enabled for the workspace, otherwise a `403`
    is returned.

## Path parameters

- `secret_id` integer, required

## Response `202`

The validity check was accepted.

## Other responses

- `401`: Invalid API key
- `403`: Forbidden
- `404`: Resource not found
- `503`: API under maintenance

## Changes

- **2026-10-26** `71d7f0a47a8e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gitguardian/apis/gitguardian-api/changes/v1/secrets/:secret_id/validity/check/post.md)

---

[API](https://skmtc.dev/gitguardian/apis/gitguardian-api.md) - [All operations](https://skmtc.dev/gitguardian/apis/gitguardian-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitguardian/apis/gitguardian-api/revisions/5829df7b9045?raw)
