---
title: "Write a secret version"
method: POST
path: "/v1/secrets"
tags: ["Secrets"]
---

# Write a secret version

`POST /v1/secrets`

## Request

- Base URL: `/` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/v1/secrets`
- Auth: HTTP bearer

Creates a new encrypted version. Admitted sandboxes retain their pinned versions. Retired ciphertext is destroyed after seven days only when no nonterminal sandbox or connection retains it.

## Request body

- SecretWrite
  - `name` string, required
  - `value` string, required: Nonempty UTF-8 secret with at most 4096 encoded bytes and no NUL characters.

## Response `201`

Success

- SecretMetadata
  - `name` string, required
  - `version` integer, required
  - `created_at` string, date-time, required
  - `id` string, required: Stable tenant secret ID shared by its versions.

## Other responses

- `default`: Error. The code, message, and fix fields describe the rejection and its remedy.

---

[API](https://skmtc.dev/nodus-compute/apis/nodus-infrastructure-execution-api.md) - [All operations](https://skmtc.dev/nodus-compute/apis/nodus-infrastructure-execution-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nodus-compute/apis/nodus-infrastructure-execution-api/revisions/a59210899d95?raw)
