---
title: "Delete a secret version"
method: DELETE
path: "/api/secrets/{id}/versions/{version}"
---

# Delete a secret version

`DELETE /api/secrets/{id}/versions/{version}`

## Request

- Base URL: `https://api.hyperbrowser.ai`
- URL: `https://api.hyperbrowser.ai/api/secrets/{id}/versions/{version}`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/hyperbrowser/apis/hyperbrowser-api/docs/api/secrets/:id/versions/:version/delete.ts> (a function with typed inputs; its response is checked against the schema)

Permanently deletes an older version of a secret. You can't delete the latest version: add a new version or delete the secret instead. Secrets are enabled for teams on request; please contact support to enable them (otherwise 403 SECRETS_FEATURE_DISABLED). Restricted API keys need the secrets.manage scope. When you're signed in rather than using an API key, you must be a team owner or admin (otherwise 403 SECRETS_ADMIN_REQUIRED).

## Path parameters

- `id` string, uuid, required
- `version` integer, required

## Response `200`

Success

- SecretVersionDeleteResponse
  - `deleted` true, required
  - `version` integer, required

## Other responses

- `400`: Invalid secret ID or version.
- `401`: Authentication required.
- `403`: API_KEY_SCOPE_DENIED (the API key lacks a required scope), SECRETS_FEATURE_DISABLED, or SECRETS_ADMIN_REQUIRED.
- `404`: SECRET_NOT_FOUND or SECRET_VERSION_NOT_FOUND.
- `409`: SECRET_VERSION_IS_LATEST: the latest version can't be deleted. SECRET_VERSION_IN_USE: a vault pins this version.
- `500`: Internal server error.

## Changes

- **2026-10-15** `6ca0b00ee564`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/hyperbrowser/apis/hyperbrowser-api/changes/api/secrets/:id/versions/:version/delete.md)

---

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