---
title: "Update a Secret"
method: PATCH
path: "/v1/projects/secrets/{id}"
---

# Update a Secret

`PATCH /v1/projects/secrets/{id}`

Updates an existing secret. You can update the name, value, description, or tags.

## Path parameters

- `id` string, required

## Request body

- UpdateSecretRequestBody
  - `name` string — The new name for the secret.
  - `value` string — The new secret value.
  - `description` string — The new description for the secret.
  - `tags` string[] — The new tags for the secret.

## Response `200`

Secret updated successfully

- UpdateSecretResponse
  - `success` boolean
  - `message` string
  - `data` object
    - `id` string
    - `name` string
    - `description` string
    - `tags` string[]
    - `lastAccessedAt` string, nullable
    - `createdAt` string
    - `updatedAt` string

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `409` — Secret with the same name already exists
- `500` — Server Side Error

---

[API](https://skmtc.net/tryhamsa/apis/hamsa-api.md) · [All operations](https://skmtc.net/tryhamsa/apis/hamsa-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryhamsa/hamsa-api/versions/ecbeb5d8dc13/schema)
