---
title: "Update a Secret."
method: POST
path: "/v1/secrets/{name}"
tags: ["secrets"]
---

# Update a Secret.

`POST /v1/secrets/{name}`

Update the value of an existing Secret by name. The new value will be encrypted at rest.

## Path parameters

- `name` string, required

## Request body

- SecretUpdateParameters — Parameters required to update an existing Secret.
  - `value` string, required — The new value for the Secret. This will replace the existing value and be encrypted at rest. Example: 'my-updated-secure-password'

## Response `200`

Secret updated successfully. Returns the Secret with its new value included.

- SecretView — A Secret represents a key-value pair that can be securely stored and used in Devboxes as environment variables.
  - `id` string, required — The unique identifier of the Secret.
  - `name` string, required — The globally unique name of the Secret. Used as the environment variable name in Devboxes.
  - `create_time_ms` integer, required — Creation time of the Secret (Unix timestamp in milliseconds).
  - `update_time_ms` integer, required — Last update time of the Secret (Unix timestamp in milliseconds).

## Other responses

- `400` — Bad request. Invalid parameters.
- `401` — Unauthorized. Invalid or missing authentication.
- `403` — Forbidden. Account does not have devbox capability.
- `404` — Secret not found.
- `500` — Internal server error.

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/e9dc776053e4/schema)
