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

# Override the validity of a secret

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

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`.

**Prerequisites**:
  - A valid API key with the secrets:write scope.

## Path parameters

- `secret_id` integer, required

## Request body

- object
  - `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.

## Response `200`

The validity override was set.

- object
  - `id` integer
  - `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.

## Other responses

- `400` — Invalid data
- `401` — Invalid API key
- `403` — Forbidden
- `404` — Resource not found
- `503` — API under maintenance

---

[API](https://skmtc.net/gitguardian/apis/gitguardian-api.md) · [All operations](https://skmtc.net/gitguardian/apis/gitguardian-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitguardian/gitguardian-api/revisions/511b067cdcb1/schema)
