---
title: "Encrypt a workspace credential. Use CLI stdin or the secure chat form; return metadata only. Do not put values in chat, manifests or scripts"
method: PUT
path: "/secrets/{name}"
tags: ["secrets"]
---

# Encrypt a workspace credential. Use CLI stdin or the secure chat form; return metadata only. Do not put values in chat, manifests or scripts

`PUT /secrets/{name}`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/secrets/{name}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Encrypt a workspace credential. Use CLI stdin or the secure chat form; return metadata only. Do not put values in chat, manifests or scripts.

## Path parameters

- `name` string, required

## Request body

- object
  - `kind` 'env' | 'file', required
  - `value` string, required
  - `expectedVersion` integer

## Response `200`

Successful response

- object
  - `name` string, required
  - `kind` 'env' | 'file', required
  - `version` number, required
  - `revision` number, required
  - `status` 'stored', required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
