---
title: "Replace the value of an existing secret"
method: PUT
path: "/v1/org/secrets/{secretId}/value"
tags: ["Secrets"]
---

# Replace the value of an existing secret

`PUT /v1/org/secrets/{secretId}/value`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/org/secrets/{secretId}/value`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Replaces a secret's encrypted value under a new version while keeping its locked type, target, and execution boundary intact. Refuses agent and API-key callers.

## Path parameters

- `secretId` string, required

## Request body

- RotateOrganizationSecretRequest
  - `secretValue` string, required

## Response `200`

Updated secret metadata.

- OrganizationSecretDetailResponse
  - `secret` OrganizationSecretSummary, required
    - `id` string, required
    - `name` string, required
    - `description` string, nullable, required
    - `secretType` 'mcp_header' | 'http_header' | 'ssh_key' | 'cli_env' | 'web_login', required
    - `executionBoundary` 'cloud_only' | 'desktop_allowed', required
    - `targetHost` string, nullable, required
    - `targetCommand` string, nullable, required
    - `headerName` string, nullable, required
    - `headerPrefix` string, nullable, required
    - `envName` string, nullable, required
    - `loginUsername` string, nullable, required
    - `keyProvider` string, required
    - `secretVersion` integer, required
    - `lastUsedAt` string, date-time, nullable, required
    - `blindUseSummary` object, required
      - `everyone` boolean, required
      - `teams` integer, required
      - `members` integer, required
      - `agents` integer, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
  - `blindUse` object, required
    - `everyone` boolean, required
    - `teams` OrganizationSecretBlindUseTeam[], required
      - `teamId` string, required
      - `name` string, required
      - `members` integer, required
      - `grantedAt` string, date-time, required
      - `grantedByMemberId` string, required
    - `principals` OrganizationSecretBlindUsePrincipal[], required
      - `memberId` string, required
      - `kind` 'member' | 'agent', required
      - `name` string, nullable, required
      - `email` string, nullable, required
      - `agentId` string, nullable, required
      - `grantedAt` string, date-time, required
      - `grantedByMemberId` string, required
  - `rules` OrganizationSecretRule[], required
    - `id` string, required
    - `subjectKind` 'organization' | 'team' | 'member' | 'agent', required
    - `subjectId` string, required
    - `rule` 'allow' | 'ask' | 'block', required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Invalid request or machine caller attempted to write a secret.
- `401`: Sign-in required.
- `403`: Missing permission, recent sign-in, or blind-use authorization.
- `404`: Organization secrets are off or resource not found.

## Changes

- **2026-12-03** `b433928052b7`: 4 breaking
  - removed the required property `secret/sshFingerprint` from the response with the `200` status
  - removed the required property `secret/sshPublicKey` from the response with the `200` status
  - removed the required property `secret/targetConnectionId` from the response with the `200` status
  - removed the required property `secret/targetConnectionName` from the response with the `200` status
- **2026-12-03** `6a95d77df4da`: 1 warning, 2 info
  - added the new `web_login` enum value to the `secret/secretType` response property for the response status `200`
  - added the required property `secret/lastUsedAt` to the response with the `200` status
  - added the required property `secret/loginUsername` to the response with the `200` status
- **2026-12-02** `1c1cd9580c18`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/org/secrets/:secretId/value/put.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
