---
title: "Delete a Secret"
method: DELETE
path: "/kubernetes/{id}/namespaces/{namespace}/secrets/{secret}"
tags: ["kubernetes"]
---

# Delete a Secret

`DELETE /kubernetes/{id}/namespaces/{namespace}/secrets/{secret}`

Delete a Secret in the given namespace.
**Access policy**: Authenticated user.

## Path parameters

- `id` integer, required
- `namespace` string, required
- `secret` string, required

## Response `204`

Success

## Other responses

- `400` — Invalid request payload, such as missing required fields or fields not meeting validation criteria.
- `401` — Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions.
- `403` — Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions.
- `404` — Unable to find the secret to delete.
- `500` — Server error occurred while attempting to delete the secret.

---

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