---
title: "Update an existing secret by id."
method: PATCH
path: "/secrets/{id}"
tags: ["Secret Operations"]
---

# Update an existing secret by id.

`PATCH /secrets/{id}`

## Request

- Base URL: `https://replace-with-account.api.decodable.co/v1alpha2`
- URL: `https://replace-with-account.api.decodable.co/v1alpha2/secrets/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/decodable/apis/decodable-control-plane/docs/secrets/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Requires permission matching: `secret:write:default.<name>`.

## Request body

- SecretCommon: Common secret fields in requests and responses.
  - `name` string: The secret name.
  - `description` string: The secret description.

## Response `200`

A secret update response.

- Secret: Common secret fields in requests and responses.
  - `id` string, required: An opaque ID, created by Decodable, that uniquely identifies a resource.
  - `name` string, required: The secret name.
  - `description` string: The secret description.
  - `create_time` string, date-time: The date and time the resource was created.
  - `update_time` string, date-time: The date and time the resource was updated.

## Other responses

- `400`: An invalid request was received.
- `403`: Access denied: requesting user lacks a required permission.
- `404`: The requested resource does not exist.
- `409`: A resource conflict has been detected.
- `default`: An error has occurred.

---

[API](https://skmtc.dev/decodable/apis/decodable-control-plane.md) - [All operations](https://skmtc.dev/decodable/apis/decodable-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/decodable/apis/decodable-control-plane/revisions/9718a3019da8?raw)
