---
title: "Delete an organization secret"
method: DELETE
path: "/v1/orgs/{orgId}/secrets/{secretName}"
tags: ["Secrets"]
---

# Delete an organization secret

`DELETE /v1/orgs/{orgId}/secrets/{secretName}`

## Request

- Base URL: `https://api.spice.ai`
- URL: `https://api.spice.ai/v1/orgs/{orgId}/secrets/{secretName}`
- Auth: HTTP bearer

Deletes an organization secret and every project link to it. Deployments that reference it stop receiving it on their next deploy.

## Path parameters

- `orgId` integer, required
- `secretName` string, required

## Headers

- `X-Org-Name` string

## Response `204`

Secret deleted

## Other responses

- `400`: Invalid org id (`invalid_org_id`), X-Org-Name does not name that org (`org_path_mismatch`), or invalid secret name
- `401`: Unauthorized
- `403`: Insufficient scope (requires secrets:write), the caller is not an admin or owner, or not a member of the organization (`org_forbidden`), a machine credential named an organization other than its own (`org_assertion_mismatch`), or the organization a machine credential is bound to has been deleted (`org_deleted`)
- `404`: Secret not found
- `500`: Internal server error

---

[API](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api.md) - [All operations](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/revisions/5f3b75dd847d?raw)
