---
search:
  tags:
    - Secrets
    - DELETE
seo:
  description: >-
    Deletes one secret from a project environment. The deletion is recorded in
    the… Reference for the DELETE /secrets/{secretId} endpoint in the varsafe
    API.
sidebar:
  label: Delete a secret
  badge: DELETE
title: Delete a secret
type: openapi-operation
---
Deletes one secret from a project environment. The deletion is recorded in the audit trail and, on plans with versioning, earlier versions remain recoverable.

`DELETE /secrets/{secretId}`

**Responses**

- `200` — Success.
- `400` — The request failed validation. \`field\` names the offending input.
- `401` — No credential was presented, or it is invalid or revoked.
- `403` — The credential is valid but lacks the required scope, role or team access.
- `404` — The resource does not exist, or is not visible to this credential.
- `429` — Rate limited. Retry after the interval named in the response.
- `500` — Unexpected server error. The body never carries internal detail.

Response example, 200:

```json
{
  "key": "string",
  "alsoDeleted": [
    "string"
  ],
  "flattened": [
    "string"
  ]
}
```
