---
title: "Update secret"
method: PUT
path: "/secrets/{namespace}/{name}"
tags: ["secrets"]
---

# Update secret

`PUT /secrets/{namespace}/{name}`

Updates an existing secret.

## Path parameters

- `namespace` string, required
- `name` string, required

## Request body

- SecretsSecretUpdate
  - `contents` SecretsSecretData, required
  - `immutable` boolean, required
  - `type` string, required

## Response `200`

Secret updated successfully

- ApiSecretEnvelope
  - `data` SecretsSecretUpdate, required
    - `contents` SecretsSecretData, required
    - `immutable` boolean, required
    - `type` string, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Secret not found
- `413` — Request Entity Too Large. The request body is too large.
- `415` — Unsupported Media Type. Content-Type header is not correct.
- `422` — Unprocessable Entity. Validation error.
- `500` — Internal server error

---

[API](https://skmtc.dev/opendatahub-io/apis/kubeflow-notebooks-api.md) · [All operations](https://skmtc.dev/opendatahub-io/apis/kubeflow-notebooks-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/opendatahub-io/kubeflow-notebooks-api/revisions/97fe86faf733/schema)
